nakas commited on
Commit
39f1cb1
·
verified ·
1 Parent(s): 8cbd526

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.9-slim
2
 
3
- # Install dependencies
4
  RUN apt-get update && apt-get install -y \
5
  chromium \
6
  chromium-driver \
@@ -8,11 +8,14 @@ RUN apt-get update && apt-get install -y \
8
  libfontconfig1 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Set environment variables for Matplotlib & Fontconfig
12
  ENV MPLCONFIGDIR=/tmp/matplotlib
13
  ENV FONTCONFIG_PATH=/etc/fonts
14
  ENV HOME=/root
15
 
 
 
 
16
  # Install Python dependencies
17
  COPY requirements.txt .
18
  RUN pip install --no-cache-dir -r requirements.txt
@@ -21,8 +24,8 @@ RUN pip install --no-cache-dir -r requirements.txt
21
  COPY . /app
22
  WORKDIR /app
23
 
24
- # Create Fontconfig cache (optional)
25
- RUN mkdir -p /root/.cache/fontconfig && fc-cache -f -v
26
 
27
  # Run application
28
  CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Install required packages
4
  RUN apt-get update && apt-get install -y \
5
  chromium \
6
  chromium-driver \
 
8
  libfontconfig1 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Set environment variables for Fontconfig and Matplotlib
12
  ENV MPLCONFIGDIR=/tmp/matplotlib
13
  ENV FONTCONFIG_PATH=/etc/fonts
14
  ENV HOME=/root
15
 
16
+ # Create Fontconfig cache directory and set permissions
17
+ RUN mkdir -p /root/.cache/fontconfig && chmod -R 777 /root/.cache/fontconfig
18
+
19
  # Install Python dependencies
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
 
24
  COPY . /app
25
  WORKDIR /app
26
 
27
+ # Generate Fontconfig cache
28
+ RUN fc-cache -f -v
29
 
30
  # Run application
31
  CMD ["python", "app.py"]