high77 commited on
Commit
110da2a
·
verified ·
1 Parent(s): 804283b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 and clean up to reduce image size
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 Python dependencies first to leverage Docker cache
15
  COPY requirements.txt ./
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy source code and model directory after dependencies installed
19
  COPY src/ ./src/
20
- COPY model/ ./model/
 
21
 
22
- # Expose the Streamlit default port
23
  EXPOSE 8501
24
 
25
- # Healthcheck to monitor app readiness (optional but recommended)
26
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
27
  CMD curl --fail http://localhost:8501/_stcore/health || exit 1
28
 
29
- # Run the Streamlit app on all network interfaces on port 8501
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"]