Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
# Install
|
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
|
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 |
-
#
|
25 |
-
RUN
|
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"]
|