andevs commited on
Commit
0f1b9b5
·
verified ·
1 Parent(s): 5432102

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -8
Dockerfile CHANGED
@@ -9,8 +9,10 @@ RUN apt-get update && apt-get install -y \
9
  curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copy requirements first for better caching
13
  COPY requirements.txt .
 
 
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
  # Copy application
@@ -20,12 +22,7 @@ COPY . .
20
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
21
  USER appuser
22
 
23
- # Health check
24
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
25
- CMD python -c "import requests; r = requests.get('http://localhost:7860/health', timeout=2); exit(0 if r.status_code == 200 else 1)"
26
-
27
- # Expose port
28
  EXPOSE 7860
29
 
30
- # Run with gunicorn for production
31
- CMD ["gunicorn", "app:app", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "--timeout", "120", "--keep-alive", "5"]
 
9
  curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy requirements first (better caching)
13
  COPY requirements.txt .
14
+
15
+ # Install Python dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Copy application
 
22
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
23
  USER appuser
24
 
 
 
 
 
 
25
  EXPOSE 7860
26
 
27
+ # Run with uvicorn
28
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]