Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile
|
| 2 |
+
# Use a standard Python 3.9 image
|
| 3 |
+
FROM python:3.9-slim
|
| 4 |
+
|
| 5 |
+
# Set the working directory inside the container
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
# Copy the requirements file and install dependencies
|
| 9 |
+
COPY requirements.txt requirements.txt
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
+
|
| 12 |
+
# Copy your application code into the container
|
| 13 |
+
COPY . .
|
| 14 |
+
|
| 15 |
+
# Tell the container to listen on port 7860 (the standard for HF Spaces)
|
| 16 |
+
EXPOSE 7860
|
| 17 |
+
|
| 18 |
+
# Command to run your Flask app using gunicorn web server
|
| 19 |
+
# This is more robust than Flask's built-in server
|
| 20 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "app:app"]
|