Update Dockerfile
Browse files- Dockerfile +10 -1
Dockerfile
CHANGED
|
@@ -13,4 +13,13 @@ COPY app.py .
|
|
| 13 |
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 17 |
+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')"
|
| 18 |
+
|
| 19 |
+
# Shell form so $WEB_CONCURRENCY is expanded at runtime (set to 4 in HF Spaces)
|
| 20 |
+
# uvicorn.workers.UvicornWorker = correct ASGI worker class for FastAPI + Gunicorn
|
| 21 |
+
CMD gunicorn app:app \
|
| 22 |
+
--workers ${WEB_CONCURRENCY:-4} \
|
| 23 |
+
--bind 0.0.0.0:7860 \
|
| 24 |
+
--timeout 120 \
|
| 25 |
+
--worker-class uvicorn.workers.UvicornWorker
|