Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -5
Dockerfile
CHANGED
@@ -1,13 +1,21 @@
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
3 |
RUN useradd -m -u 1000 user
|
4 |
-
USER user
|
5 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
6 |
|
|
|
7 |
WORKDIR /app
|
8 |
|
9 |
-
|
|
|
10 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.9
|
3 |
|
4 |
+
# Create a new user named 'user'
|
5 |
RUN useradd -m -u 1000 user
|
|
|
|
|
6 |
|
7 |
+
# Set the working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
+
# Copy the requirements file and install dependencies
|
11 |
+
COPY --chown=user requirements.txt requirements.txt
|
12 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
13 |
|
14 |
+
# Copy the rest of the application code
|
15 |
+
COPY --chown=user . .
|
16 |
+
|
17 |
+
# Set the user to 'user'
|
18 |
+
USER user
|
19 |
+
|
20 |
+
# Set the entrypoint command to run the application
|
21 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|