Update Dockerfile
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
|
@@ -1,13 +1,17 @@
|
|
| 1 |
-
|
| 2 |
FROM python:3.10-slim
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
EXPOSE 5000
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
| 1 |
+
# Use official Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy files to the container
|
| 8 |
+
COPY . /app
|
| 9 |
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Expose port (Hugging Face expects 7860, but Flask uses 5000 — both fine)
|
| 14 |
EXPOSE 5000
|
| 15 |
|
| 16 |
+
# Run the app with gunicorn
|
| 17 |
+
CMD ["gunicorn", "--workers", "2", "--threads", "2", "--timeout", "120", "--bind", "0.0.0.0:5000", "app:app"]
|