Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -3,7 +3,7 @@ FROM python:3.9-slim
|
|
| 3 |
# Set working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
|
@@ -11,20 +11,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Copy requirements and install
|
| 15 |
COPY requirements.txt ./
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
# Copy source code and model
|
| 19 |
COPY src/ ./src/
|
| 20 |
-
COPY
|
|
|
|
| 21 |
|
| 22 |
-
# Expose
|
| 23 |
EXPOSE 8501
|
| 24 |
|
| 25 |
-
#
|
| 26 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 27 |
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 28 |
|
| 29 |
-
#
|
| 30 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 3 |
# Set working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
|
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy requirements and install dependencies
|
| 15 |
COPY requirements.txt ./
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
+
# Copy source code and model files
|
| 19 |
COPY src/ ./src/
|
| 20 |
+
COPY Hb_predict/tuned_xgboost_model.pkl ./tuned_xgboost_model.pkl
|
| 21 |
+
COPY Hb_predict/scaler.pkl ./scaler.pkl
|
| 22 |
|
| 23 |
+
# Expose default Streamlit port
|
| 24 |
EXPOSE 8501
|
| 25 |
|
| 26 |
+
# Optional health check
|
| 27 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 28 |
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 29 |
|
| 30 |
+
# Start Streamlit app
|
| 31 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|