Luigi commited on
Commit
4fd675b
·
verified ·
1 Parent(s): 6698b74

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -2,29 +2,31 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
  git \
9
  ffmpeg \
10
- build-essential \
11
  cmake \
12
  libopenblas-dev \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Set writable directories
16
- ENV HF_HOME=/app/.cache/huggingface
17
- ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
18
- RUN mkdir -p /app/.cache/huggingface /app/.streamlit
19
 
20
- # Set HF cache to a writable path
21
- ENV HF_HOME=/app/.cache/huggingface
22
- RUN mkdir -p /app/.cache/huggingface
23
 
 
24
  COPY requirements.txt ./
25
  COPY src/ ./src/
26
 
27
- RUN pip3 install -r requirements.txt
 
28
 
29
  EXPOSE 8501
30
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system packages
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
9
  git \
10
  ffmpeg \
 
11
  cmake \
12
  libopenblas-dev \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # === FIX PERMISSION ERRORS ===
16
+ # Set writable cache/config paths for Streamlit, Hugging Face, and Matplotlib
17
+ ENV HF_HOME=/tmp/huggingface
18
+ ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit
19
 
20
+ # Create those directories and make them writable
21
+ RUN mkdir -p /tmp/.streamlit /tmp/huggingface && \
22
+ chmod -R 777 /tmp/.streamlit /tmp/huggingface
23
 
24
+ # Copy files
25
  COPY requirements.txt ./
26
  COPY src/ ./src/
27
 
28
+ # Install Python dependencies
29
+ RUN pip3 install --no-cache-dir -r requirements.txt
30
 
31
  EXPOSE 8501
32