devxpy commited on
Commit
dba49ba
·
verified ·
1 Parent(s): ec17c6d

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. 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
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
76
- CMD curl -f http://localhost:8000/health || exit 1
 
77
 
78
  # Run the FastAPI server
79
- # The module path is constructed to work with the /app/env structure
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}"]