lp128396 commited on
Commit
a18c234
Β·
verified Β·
1 Parent(s): e1b6b80

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -8
Dockerfile CHANGED
@@ -1,36 +1,30 @@
1
  FROM python:3.9-slim
2
 
3
- # βœ… Safe writable envs
4
  ENV PYTHONUNBUFFERED=1 \
5
  PORT=8501 \
6
  HF_HOME=/tmp/huggingface \
 
7
  STREAMLIT_HOME=/tmp/.streamlit \
8
- STREAMLIT_CONFIG_DIR=/tmp/.streamlit \
9
  STREAMLIT_SERVER_HEADLESS=true \
10
  STREAMLIT_SERVER_PORT=8501 \
11
  STREAMLIT_SERVER_ADDRESS=0.0.0.0
12
 
13
  WORKDIR /app
14
 
15
- # βœ… Install system dependencies
16
  RUN apt-get update && apt-get install -y \
17
  build-essential \
18
  curl \
19
  git \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
- # βœ… Copy files
23
  COPY requirements.txt ./
24
  COPY src/ ./src/
25
 
26
- # βœ… Install Python packages
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
29
- # βœ… Expose Streamlit port
30
  EXPOSE 8501
31
 
32
- # βœ… Healthcheck for Hugging Face Spaces
33
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
34
 
35
- # βœ… Run Streamlit
36
  ENTRYPOINT ["streamlit", "run", "src/app.py"]
 
1
  FROM python:3.9-slim
2
 
3
+ # βœ… Define all writable paths explicitly
4
  ENV PYTHONUNBUFFERED=1 \
5
  PORT=8501 \
6
  HF_HOME=/tmp/huggingface \
7
+ XDG_CACHE_HOME=/tmp/.cache \
8
  STREAMLIT_HOME=/tmp/.streamlit \
 
9
  STREAMLIT_SERVER_HEADLESS=true \
10
  STREAMLIT_SERVER_PORT=8501 \
11
  STREAMLIT_SERVER_ADDRESS=0.0.0.0
12
 
13
  WORKDIR /app
14
 
 
15
  RUN apt-get update && apt-get install -y \
16
  build-essential \
17
  curl \
18
  git \
19
  && rm -rf /var/lib/apt/lists/*
20
 
 
21
  COPY requirements.txt ./
22
  COPY src/ ./src/
23
 
 
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
 
26
  EXPOSE 8501
27
 
 
28
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
29
 
 
30
  ENTRYPOINT ["streamlit", "run", "src/app.py"]