ak0601 commited on
Commit
a46fd7f
·
verified ·
1 Parent(s): cad1989

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -5
Dockerfile CHANGED
@@ -1,20 +1,33 @@
1
- FROM python:3.13.5-slim
 
 
 
 
 
 
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
13
-
14
  RUN pip3 install -r requirements.txt
15
 
 
 
 
 
 
 
16
  EXPOSE 8501
17
 
18
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
19
 
20
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
+ # Use Python 3.12 (better compatibility for scikit-learn/scipy)
2
+ FROM python:3.12-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PYTHONDONTWRITEBYTECODE=1 \
7
+ PIP_NO_CACHE_DIR=1
8
 
9
  WORKDIR /app
10
 
11
+ # Install system dependencies
12
  RUN apt-get update && apt-get install -y \
13
  build-essential \
14
  curl \
15
  git \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Copy requirements FIRST (optimizes Docker caching)
19
+ COPY requirements.txt .
 
20
  RUN pip3 install -r requirements.txt
21
 
22
+ # Copy the ENTIRE project (including app/ folder and app.py)
23
+ COPY . .
24
+
25
+ # Ensure the app directory is reachable
26
+ ENV PYTHONPATH=/app
27
+
28
  EXPOSE 8501
29
 
30
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
31
 
32
+ # Run the streamlit app
33
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]