Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +8 -17
Dockerfile
CHANGED
|
@@ -1,25 +1,16 @@
|
|
| 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 |
-
|
| 8 |
-
# This layer only rebuilds if requirements.txt is modified
|
| 9 |
-
COPY requirements.txt /app/requirements.txt
|
| 10 |
-
|
| 11 |
-
# Install Python dependencies
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
COPY
|
| 17 |
-
COPY boston_housing_model.pkl /app/
|
| 18 |
-
COPY preprocessor.pkl /app/
|
| 19 |
-
|
| 20 |
-
# Expose port 5000 for the Flask application
|
| 21 |
-
EXPOSE 5000
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
| 8 |
+
COPY app.py .
|
| 9 |
+
COPY boston_housing_model.pkl .
|
| 10 |
+
COPY preprocessor.pkl .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
# Expose the port Hugging Face provides
|
| 13 |
+
EXPOSE ${PORT}
|
| 14 |
|
| 15 |
+
# Use the PORT environment variable
|
| 16 |
+
CMD exec gunicorn --bind 0.0.0.0:${PORT} app:app
|