Update Dockerfile
Browse files- Dockerfile +11 -12
Dockerfile
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
-
FROM
|
2 |
-
|
3 |
-
|
4 |
-
# RUN useradd -m -u 1000 user
|
5 |
-
|
6 |
-
# Specify the user to use (if necessary)
|
7 |
-
# USER user
|
8 |
-
|
9 |
-
# Set the environment variable for PATH, if needed
|
10 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
|
|
|
|
11 |
|
12 |
-
|
|
|
|
|
13 |
EXPOSE 5000
|
14 |
|
15 |
-
#
|
16 |
-
CMD ["--
|
|
|
1 |
+
FROM python:3.9
|
2 |
+
RUN useradd -m -u 1000 user
|
3 |
+
USER user
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
ENV PATH="/home/user/.local/bin:$PATH"
|
5 |
+
WORKDIR /code
|
6 |
+
|
7 |
+
RUN pip install fastapi requests libretranslate uvicorn[standard]==0.17.*
|
8 |
|
9 |
+
COPY . .
|
10 |
+
COPY --chown=user . /app
|
11 |
+
# Expose the port FastAPI will use
|
12 |
EXPOSE 5000
|
13 |
|
14 |
+
# Command to run the FastAPI app with uvicorn
|
15 |
+
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "5000"]
|