Upload folder using huggingface_hub
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -72,10 +72,11 @@ ENV PATH="/app/.venv/bin:$PATH"
|
|
| 72 |
ENV PYTHONPATH="/app/env:$PYTHONPATH"
|
| 73 |
|
| 74 |
# Health check
|
| 75 |
-
|
| 76 |
-
|
|
|
|
| 77 |
|
| 78 |
# Run the FastAPI server
|
| 79 |
-
#
|
| 80 |
ENV ENABLE_WEB_INTERFACE=true
|
| 81 |
-
CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port 8000"]
|
|
|
|
| 72 |
ENV PYTHONPATH="/app/env:$PYTHONPATH"
|
| 73 |
|
| 74 |
# Health check
|
| 75 |
+
# Use Python stdlib instead of curl so the probe works even if curl is absent.
|
| 76 |
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=5 \
|
| 77 |
+
CMD python -c "import os,urllib.request; port=os.getenv('PORT','8000'); r=urllib.request.urlopen(f'http://localhost:{port}/health', timeout=3); raise SystemExit(0 if r.status==200 else 1)"
|
| 78 |
|
| 79 |
# Run the FastAPI server
|
| 80 |
+
# Respect PORT if the platform injects one; default to 8000.
|
| 81 |
ENV ENABLE_WEB_INTERFACE=true
|
| 82 |
+
CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port ${PORT:-8000}"]
|