Spaces:
Sleeping
Sleeping
Commit
·
d9f84a0
1
Parent(s):
a7bc54f
Update Dockerfile
Browse files- Dockerfile +11 -11
Dockerfile
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# For more information, please refer to https://aka.ms/vscode-docker-python
|
2 |
|
3 |
FROM python:3.10
|
4 |
|
@@ -7,21 +6,22 @@ USER user
|
|
7 |
|
8 |
# Dockerfile
|
9 |
|
|
|
|
|
10 |
# Copy local code to the container image.
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
RUN pip install --no-cache-dir --upgrade pip
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
-
COPY --chown=user . /app
|
19 |
-
|
20 |
|
21 |
-
# Run the web service on container startup. Here we use the gunicorn
|
22 |
-
# webserver, with one worker process and 8 threads.
|
23 |
-
# For environments with multiple CPU cores, increase the number of workers
|
24 |
-
# to be equal to the cores available.
|
25 |
-
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
|
26 |
CMD exec gunicorn --bind :7860 --workers 1 --threads 8 --timeout 0 app:app
|
27 |
|
|
|
|
|
|
|
|
1 |
|
2 |
FROM python:3.10
|
3 |
|
|
|
6 |
|
7 |
# Dockerfile
|
8 |
|
9 |
+
# Allow statements and log messages to immediately appear in the logs
|
10 |
+
ENV PYTHONUNBUFFERED True
|
11 |
# Copy local code to the container image.
|
12 |
+
|
13 |
+
ENV HOME=/home/user \
|
14 |
+
PATH=/home/user/.local/bin:$PATH
|
15 |
+
|
16 |
+
WORKDIR $HOME/app
|
17 |
+
COPY . $HOME/app
|
18 |
|
19 |
RUN pip install --no-cache-dir --upgrade pip
|
20 |
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
|
22 |
+
COPY --chown=user . $HOME/app
|
|
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
CMD exec gunicorn --bind :7860 --workers 1 --threads 8 --timeout 0 app:app
|
25 |
|
26 |
+
|
27 |
+
|