fmegahed commited on
Commit
c7a9a90
·
verified ·
1 Parent(s): f9f01f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -12
Dockerfile CHANGED
@@ -1,21 +1,26 @@
1
- FROM python:3.12.11
2
 
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- software-properties-common \
9
- git \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
- COPY requirements.txt ./
13
- COPY src/ ./src/
 
14
 
15
- RUN pip3 install -r requirements.txt
 
16
 
 
17
  EXPOSE 8501
18
 
19
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
 
20
 
21
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
+ FROM python:3.12.11-slim
2
 
3
+ # 1) Create and switch to the app directory
4
  WORKDIR /app
5
 
6
+ # 2) Install system dependencies
7
+ RUN apt-get update && \
8
+ apt-get install -y build-essential curl git && \
9
+ rm -rf /var/lib/apt/lists/*
 
 
10
 
11
+ # 3) Copy & install Python dependencies
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # 4) Copy all your code and data into the container
16
+ COPY . .
17
 
18
+ # 5) Expose Streamlit’s default port
19
  EXPOSE 8501
20
 
21
+ # 6) Healthcheck for Streamlit
22
+ HEALTHCHECK --interval=30s --timeout=5s \
23
+ CMD curl --fail http://localhost:8501/_stcore/health || exit 1
24
 
25
+ # 7) Launch your app.py at root
26
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]