Files changed (1) hide show
  1. Dockerfile +18 -12
Dockerfile CHANGED
@@ -1,12 +1,18 @@
1
- FROM python:3.9-slim
2
-
3
- WORKDIR /app
4
-
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
-
8
- COPY . .
9
-
10
- CMD ["python", "app.py"]
11
-
12
- EXPOSE 7860
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Set environment variables
4
+ ENV PYTHONUNBUFFERED=1
5
+
6
+ WORKDIR /app
7
+
8
+ # Install dependencies
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ # Copy the rest of the application
13
+ COPY . .
14
+
15
+ # Use Gunicorn instead of python app.py
16
+ # --bind 0.0.0.0:7860 is required for Hugging Face
17
+ # --timeout 120 helps prevent timeout errors during initialization
18
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "120", "app:app"]