rairo commited on
Commit
dc02829
·
verified ·
1 Parent(s): 9af789c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -19
Dockerfile CHANGED
@@ -2,39 +2,33 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies including OpenGL libraries
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
9
  software-properties-common \
10
  git \
11
  ffmpeg \
12
- libglib2.0-0 \
13
  libsm6 \
14
  libxext6 \
15
  libxrender-dev \
16
- libgomp1 \
17
  libgl1-mesa-glx \
18
- libglib2.0-0 \
19
- libgtk-3-0 \
20
- libavcodec-dev \
21
- libavformat-dev \
22
- libswscale-dev \
23
- libv4l-dev \
24
- libxvidcore-dev \
25
- libx264-dev \
26
- libjpeg-dev \
27
- libpng-dev \
28
- libtiff-dev \
29
- libatlas-base-dev \
30
- gfortran \
31
- wget \
32
  && rm -rf /var/lib/apt/lists/*
33
 
 
 
 
 
 
 
 
 
34
  COPY requirements.txt ./
35
- COPY src/ ./src/
36
 
37
- RUN pip3 install -r requirements.txt
38
 
39
  EXPOSE 8501
40
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
9
  software-properties-common \
10
  git \
11
  ffmpeg \
 
12
  libsm6 \
13
  libxext6 \
14
  libxrender-dev \
 
15
  libgl1-mesa-glx \
16
+ # Add fontconfig for font management
17
+ fontconfig \
 
 
 
 
 
 
 
 
 
 
 
 
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
+ # --- FIX FOR PERMISSION ERRORS ---
21
+ # Create writable cache directories inside the app's working directory
22
+ RUN mkdir -p /app/.cache/matplotlib /app/.cache/fontconfig
23
+ # Tell Matplotlib and Fontconfig to use these new directories
24
+ ENV MPLCONFIGDIR /app/.cache/matplotlib
25
+ ENV FONTCONFIG_PATH /app/.cache/fontconfig
26
+ # --- END OF FIX ---
27
+
28
  COPY requirements.txt ./
29
+ RUN pip3 install --no-cache-dir -r requirements.txt
30
 
31
+ COPY src/ ./src/
32
 
33
  EXPOSE 8501
34