File size: 1,209 Bytes
280e180
 
17740fa
 
 
 
 
 
 
 
 
 
280e180
 
17740fa
 
280e180
17740fa
97b426d
280e180
 
17740fa
 
 
 
280e180
17740fa
280e180
17740fa
 
280e180
 
 
17740fa
d24269d
280e180
17740fa
 
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
37
38
39
FROM python:3.13.5-slim

# Avoid interactive tzdata prompts and keep logs unbuffered
ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    # Make Streamlit write to a writable place (fixes '/.streamlit' permission error)
    HOME=/app \
    XDG_CONFIG_HOME=/app/.config \
    STREAMLIT_CONFIG_DIR=/app/.streamlit \
    STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

WORKDIR /app

# Minimal OS deps you actually need (curl for healthcheck, build-essential for any wheels that need compile)
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    build-essential \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# Pre-create streamlit config dir (in case Streamlit tries to write during boot)
RUN mkdir -p /app/.streamlit

# Install Python deps first to leverage Docker layer cache
COPY requirements.txt ./
RUN pip install -r requirements.txt

# Now add the rest of the app
COPY . .

EXPOSE 8501

# Healthcheck (streamlit exposes this)
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

# Run Streamlit
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]