malavikapradeep2001 commited on
Commit
fe38991
·
unverified ·
1 Parent(s): 09a360c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -3
Dockerfile CHANGED
@@ -36,8 +36,8 @@ RUN pip install -r requirements.txt || pip install -r backend/requirements.txt |
36
  # Install runtime dependencies explicitly
37
  RUN pip install --no-cache-dir fastapi uvicorn python-multipart ultralytics opencv-python-headless pillow numpy scikit-learn tensorflow keras
38
 
39
- # Hugging Face Spaces expect port 7860
40
  EXPOSE 7860
41
 
42
- # Run FastAPI app
43
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
36
  # Install runtime dependencies explicitly
37
  RUN pip install --no-cache-dir fastapi uvicorn python-multipart ultralytics opencv-python-headless pillow numpy scikit-learn tensorflow keras
38
 
39
+ # Hugging Face Spaces sets PORT (default 7860). Listen on $PORT for compatibility.
40
  EXPOSE 7860
41
 
42
+ # Run FastAPI app (respect PORT env var if set by the platform)
43
+ CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"]