Upload Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Define the command to run the application
|
| 2 |
# We use gunicorn to run the Flask app defined in app.py
|
| 3 |
# The host is set to 0.0.0.0 to be accessible from outside the container
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy the dependencies file to the working directory
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Install any needed packages specified in requirements.txt
|
| 11 |
+
# Use --no-cache-dir to reduce image size
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy the rest of the application's code to the working directory
|
| 15 |
+
COPY . .
|
| 16 |
+
|
| 17 |
+
# Expose the port that the application will run on
|
| 18 |
+
# Hugging Face Spaces expects the app to be served on port 7860
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
|
| 21 |
# Define the command to run the application
|
| 22 |
# We use gunicorn to run the Flask app defined in app.py
|
| 23 |
# The host is set to 0.0.0.0 to be accessible from outside the container
|