Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +23 -19
Dockerfile
CHANGED
|
@@ -1,19 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Use the official Python 3.12 slim image. This version supports
|
| 2 |
+
newer libraries like numpy==2.3.3 which require Python 3.11 or higher.
|
| 3 |
+
FROM python:3.12-slim
|
| 4 |
+
|
| 5 |
+
Set the working directory in the container
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
Copy the requirements file into the container
|
| 9 |
+
COPY requirements.txt .
|
| 10 |
+
|
| 11 |
+
Install all Python dependencies, using the updated base image
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
Copy the rest of the application code
|
| 15 |
+
COPY . .
|
| 16 |
+
|
| 17 |
+
Install gunicorn, which will be used to run the Flask app
|
| 18 |
+
RUN pip install gunicorn
|
| 19 |
+
|
| 20 |
+
Define the default command to run the application using gunicorn.
|
| 21 |
+
The app:app assumes your Flask app instance is named app inside app.py.
|
| 22 |
+
The port is set to 7860 as required by Hugging Face Spaces.
|
| 23 |
+
CMD exec gunicorn --bind :7860 --workers 1 --threads 8 app:app
|