Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +23 -0
Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official lightweight Python runtime as a parent image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy the file that lists the dependencies to the working directory
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Install the dependencies from requirements.txt
|
| 11 |
+
# --no-cache-dir ensures the image is smaller
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy all the other files from your local project folder (app.py, model.pkl)
|
| 15 |
+
# into the container's working directory
|
| 16 |
+
COPY . .
|
| 17 |
+
|
| 18 |
+
# Inform Docker that the container listens on port 8080 at runtime
|
| 19 |
+
EXPOSE 8080
|
| 20 |
+
|
| 21 |
+
# Define the command to run your application
|
| 22 |
+
# This will execute "python app.py" when the container starts
|
| 23 |
+
CMD ["python", "app.py"]
|