Spaces:
Runtime error
Runtime error
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +17 -0
Dockerfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a minimal base image with Python 3.9 installed
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory inside the container to /app
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy all files from the current directory on the host to the container's /app directory
|
| 8 |
+
COPY . .
|
| 9 |
+
|
| 10 |
+
# Install Python dependencies listed in requirements.txt
|
| 11 |
+
# Include gunicorn as a dependency to run the Flask app
|
| 12 |
+
RUN pip3 install -r requirements.txt gunicorn
|
| 13 |
+
|
| 14 |
+
# Define the command to run the Flask application using Gunicorn
|
| 15 |
+
# 'app:SuperKart_predictions_api' specifies the module (app.py) and the Flask app instance name (SuperKart_predictions_api)
|
| 16 |
+
# -b 0.0.0.0:7860 binds Gunicorn to all network interfaces on port 7860 (default for Hugging Face Spaces Docker SDK)
|
| 17 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:SuperKart_predictions_api"]
|