File size: 904 Bytes
03a6894
f0a4c0b
03a6894
f0a4c0b
8f6608e
03a6894
 
 
 
8f6608e
 
f0a4c0b
8f6608e
03a6894
 
f0a4c0b
03a6894
 
 
f0a4c0b
03a6894
 
f0a4c0b
8f6608e
 
 
 
f0a4c0b
03a6894
 
 
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
FROM python:3.11-slim

WORKDIR /app

# Make Streamlit write to /app/.streamlit (not /.streamlit) and disable usage stats
ENV PYTHONUNBUFFERED=1 \
    PORT=7860 \
    STREAMLIT_SERVER_HEADLESS=true \
    STREAMLIT_BROWSER_GATHERUSAGESTATS=false \
    STREAMLIT_CONFIG_DIR=/app/.streamlit \
    HOME=/app

# Minimal OS deps + tini
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates curl tini && rm -rf /var/lib/apt/lists/*

# Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# App code
COPY . .

# Ensure config dir exists and has a config file
RUN mkdir -p /app/.streamlit && \
    printf "[browser]\ngatherUsageStats = false\n" > /app/.streamlit/config.toml && \
    chmod -R 777 /app/.streamlit

EXPOSE 7860
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860"]