Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +11 -2
Dockerfile
CHANGED
|
@@ -51,6 +51,7 @@ RUN mkdir -p uploads results checkpoints temp \
|
|
| 51 |
# Ensure the entire app directory is writable
|
| 52 |
RUN chmod -R 777 /app
|
| 53 |
|
|
|
|
| 54 |
# Expose the inference port
|
| 55 |
EXPOSE 7860
|
| 56 |
|
|
@@ -58,5 +59,13 @@ EXPOSE 7860
|
|
| 58 |
ENV FLASK_APP=app.py \
|
| 59 |
FLASK_ENV=production
|
| 60 |
|
| 61 |
-
# Launch with Gunicorn
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
# Ensure the entire app directory is writable
|
| 52 |
RUN chmod -R 777 /app
|
| 53 |
|
| 54 |
+
# Expose the inference port
|
| 55 |
# Expose the inference port
|
| 56 |
EXPOSE 7860
|
| 57 |
|
|
|
|
| 59 |
ENV FLASK_APP=app.py \
|
| 60 |
FLASK_ENV=production
|
| 61 |
|
| 62 |
+
# Launch with Gunicorn:
|
| 63 |
+
# - gthread: threaded worker class
|
| 64 |
+
# - threads=2: two threads per worker
|
| 65 |
+
# - timeout=600: 10-minute timeout to cover long inferences
|
| 66 |
+
CMD ["gunicorn", \
|
| 67 |
+
"--worker-class", "gthread", \
|
| 68 |
+
"--threads", "2", \
|
| 69 |
+
"--timeout", "600", \
|
| 70 |
+
"--bind", "0.0.0.0:7860", \
|
| 71 |
+
"app:app"]
|