Amey9766 commited on
Commit
274d28b
·
verified ·
1 Parent(s): 0f1a4f6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -11
Dockerfile CHANGED
@@ -1,39 +1,38 @@
1
  # Base image
2
  FROM python:3.13-slim
3
 
4
- # Set work directory
5
  WORKDIR /app
6
 
7
- # Install required system packages
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  build-essential \
10
  curl \
11
  git \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Environment variables to avoid permission and cache issues
15
  ENV PYTHONDONTWRITEBYTECODE=1 \
16
  PYTHONUNBUFFERED=1 \
17
  PIP_NO_CACHE_DIR=1
18
 
19
- # ---- Fix Streamlit permission error & disable telemetry ----
20
  ENV STREAMLIT_HOME=/tmp
21
  ENV STREAMLIT_TELEMETRY_ENABLED=false
22
- # ------------------------------------------------------------
23
 
24
- # Copy dependency file and install Python requirements
25
  COPY requirements.txt .
26
  RUN pip install -r requirements.txt
27
 
28
- # Copy all project files (since you have no src folder)
29
  COPY . .
30
 
31
- # Expose Streamlit default port
32
  EXPOSE 8501
33
 
34
- # Healthcheck (optional)
35
- HEALTHCHECK --interval=30s --timeout=3s --start-period=20s --retries=3 \
36
  CMD curl -fsS http://localhost:8501/_stcore/health || exit 1
37
 
38
- # Run Streamlit
39
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
  # Base image
2
  FROM python:3.13-slim
3
 
4
+ # Workdir
5
  WORKDIR /app
6
 
7
+ # System deps (curl for healthcheck, build tools for wheels)
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  build-essential \
10
  curl \
11
  git \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Python env hygiene
15
  ENV PYTHONDONTWRITEBYTECODE=1 \
16
  PYTHONUNBUFFERED=1 \
17
  PIP_NO_CACHE_DIR=1
18
 
19
+ # Fix Streamlit permission error & disable telemetry
20
  ENV STREAMLIT_HOME=/tmp
21
  ENV STREAMLIT_TELEMETRY_ENABLED=false
 
22
 
23
+ # Install Python deps first (better caching)
24
  COPY requirements.txt .
25
  RUN pip install -r requirements.txt
26
 
27
+ # Copy the rest of the project (you don't have a src/ folder)
28
  COPY . .
29
 
30
+ # Streamlit port
31
  EXPOSE 8501
32
 
33
+ # Healthcheck
34
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=25s --retries=3 \
35
  CMD curl -fsS http://localhost:8501/_stcore/health || exit 1
36
 
37
+ # Run app
38
  CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]