jsantangelo commited on
Commit
8f6608e
·
verified ·
1 Parent(s): 3f3f190

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -2,13 +2,15 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
 
5
  ENV PYTHONUNBUFFERED=1 \
6
  PORT=7860 \
7
  STREAMLIT_SERVER_HEADLESS=true \
8
  STREAMLIT_BROWSER_GATHERUSAGESTATS=false \
9
- STREAMLIT_CONFIG_DIR=/app/.streamlit
 
10
 
11
- # minimal OS deps + tini for clean PID 1
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  ca-certificates curl tini && rm -rf /var/lib/apt/lists/*
14
 
@@ -19,8 +21,10 @@ RUN pip install --no-cache-dir -r requirements.txt
19
  # App code
20
  COPY . .
21
 
22
- # avoid permission errors for Streamlit internal files
23
- RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit
 
 
24
 
25
  EXPOSE 7860
26
  ENTRYPOINT ["/usr/bin/tini", "--"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Make Streamlit write to /app/.streamlit (not /.streamlit) and disable usage stats
6
  ENV PYTHONUNBUFFERED=1 \
7
  PORT=7860 \
8
  STREAMLIT_SERVER_HEADLESS=true \
9
  STREAMLIT_BROWSER_GATHERUSAGESTATS=false \
10
+ STREAMLIT_CONFIG_DIR=/app/.streamlit \
11
+ HOME=/app
12
 
13
+ # Minimal OS deps + tini
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
  ca-certificates curl tini && rm -rf /var/lib/apt/lists/*
16
 
 
21
  # App code
22
  COPY . .
23
 
24
+ # Ensure config dir exists and has a config file
25
+ RUN mkdir -p /app/.streamlit && \
26
+ printf "[browser]\ngatherUsageStats = false\n" > /app/.streamlit/config.toml && \
27
+ chmod -R 777 /app/.streamlit
28
 
29
  EXPOSE 7860
30
  ENTRYPOINT ["/usr/bin/tini", "--"]