MBG0903 commited on
Commit
a66f0ef
·
verified ·
1 Parent(s): f33921f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -17
Dockerfile CHANGED
@@ -1,35 +1,28 @@
1
- # 1) Base image
2
  FROM python:3.11-slim
3
 
4
- # 2) System deps (optional but handy for fonts/locales)
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
- build-essential \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- # 3) Workdir
10
  WORKDIR /app
11
- ENV HOME=/app
12
- RUN mkdir -p /app/.streamlit
13
 
14
- # optional: turn off usage stats to avoid any writes there too
15
- ENV STREAMLIT_BROWSER_GATHERUSAGESTATS=false
 
16
 
17
- # 4) Install Python deps first (better caching)
18
  COPY requirements.txt /app/requirements.txt
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- RUN mkdir -p /.streamlit && chmod -R 777 /.streamlit
22
-
23
- # 5) Copy the app code (includes your logo in src/)
24
  COPY src /app/src
25
 
26
- # 6) Streamlit runtime settings
27
  ENV STREAMLIT_SERVER_HEADLESS=true \
28
  STREAMLIT_SERVER_PORT=8501 \
29
- STREAMLIT_SERVER_ADDRESS=0.0.0.0
 
30
 
31
- # 7) Expose the port HF expects (matches Space config)
32
  EXPOSE 8501
33
-
34
- # 8) Start the app
35
  CMD ["streamlit", "run", "src/app.py"]
 
 
1
  FROM python:3.11-slim
2
 
3
+ # System deps (fonts help Pillow render crisp text)
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ build-essential fonts-dejavu-core \
6
  && rm -rf /var/lib/apt/lists/*
7
 
 
8
  WORKDIR /app
 
 
9
 
10
+ # Make a writable home so Streamlit can store machine_id etc.
11
+ ENV HOME=/tmp
12
+ RUN mkdir -p /tmp/.streamlit && chmod -R 777 /tmp/.streamlit
13
 
14
+ # Python deps
15
  COPY requirements.txt /app/requirements.txt
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # App code
 
 
19
  COPY src /app/src
20
 
21
+ # Streamlit runtime
22
  ENV STREAMLIT_SERVER_HEADLESS=true \
23
  STREAMLIT_SERVER_PORT=8501 \
24
+ STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
25
+ STREAMLIT_BROWSER_GATHERUSAGESTATS=false
26
 
 
27
  EXPOSE 8501
 
 
28
  CMD ["streamlit", "run", "src/app.py"]