File size: 938 Bytes
8bb4589
e365408
 
8bb4589
 
 
 
e365408
 
8bb4589
 
e365408
 
 
8bb4589
 
 
 
 
 
e365408
8bb4589
e365408
 
8bb4589
 
 
e365408
 
 
8bb4589
e365408
8bb4589
 
7e212d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Dockerfile
FROM python:3.13.5-slim

ENV PIP_NO_CACHE_DIR=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

WORKDIR /app

# System deps (trim if you don't need build tools)
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    git \
  && rm -rf /var/lib/apt/lists/*

# Install Python deps first for better layer caching
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# ensure requirements.txt includes: streamlit

# App code
COPY src/ ./src/

# (Optional) run as non-root
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser

EXPOSE 8501

HEALTHCHECK CMD curl --fail --silent --show-error http://localhost:8501/_stcore/health || exit 1

# Use CMD (not ENTRYPOINT) and call streamlit as a module to avoid PATH issues
CMD ["python", "-m", "streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]