burtenshaw HF Staff commited on
Commit
c3520f5
·
verified ·
1 Parent(s): a7241e4

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -4
Dockerfile CHANGED
@@ -71,11 +71,18 @@ ENV PATH="/app/.venv/bin:$PATH"
71
  # Set PYTHONPATH so imports work correctly
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"]
 
71
  # Set PYTHONPATH so imports work correctly
72
  ENV PYTHONPATH="/app/env:$PYTHONPATH"
73
 
74
+ # Environment variables for runtime configuration
75
+ ENV WORKERS=4
76
+ ENV MAX_CONCURRENT_ENVS=100
77
+ ENV PORT=8000
78
+
79
  # Health check
80
  HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
81
+ CMD curl -f http://localhost:${PORT}/health || exit 1
82
 
83
+ # Run the FastAPI server with configurable workers
84
+ # WORKERS: Number of uvicorn worker processes (default: 4)
85
+ # MAX_CONCURRENT_ENVS: Max concurrent environment sessions (default: 100)
86
+ # PORT: Server port (default: 8000)
87
  ENV ENABLE_WEB_INTERFACE=true
88
+ CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port ${PORT} --workers ${WORKERS}"]