Update Dockerfile
Browse files- Dockerfile +13 -8
Dockerfile
CHANGED
@@ -1,16 +1,21 @@
|
|
|
|
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
|
|
|
|
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
# Expose the port FastAPI will use
|
12 |
-
# Expose the port FastAPI will use
|
13 |
-
EXPOSE 8000
|
14 |
|
15 |
-
#
|
16 |
-
CMD ["
|
|
|
1 |
+
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.9
|
3 |
+
|
4 |
+
# Create a new user and set permissions
|
5 |
RUN useradd -m -u 1000 user
|
6 |
USER user
|
7 |
+
|
8 |
+
# Set environment variables
|
9 |
ENV PATH="/home/user/.local/bin:$PATH"
|
10 |
WORKDIR /code
|
11 |
|
12 |
+
RUN pip install libretranslate waitress
|
13 |
+
|
14 |
+
# Copy the application code
|
15 |
+
COPY --chown=user . .
|
16 |
|
17 |
+
# Expose the port the app runs on
|
18 |
+
EXPOSE 7860
|
|
|
|
|
|
|
19 |
|
20 |
+
# Run the application using waitress (recommended for production)
|
21 |
+
CMD ["waitress-serve", "--host", "0.0.0.0", "--port", "7860", "app:main"]
|