Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -5
Dockerfile
CHANGED
@@ -5,10 +5,15 @@ FROM python:3.10-slim
|
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
7 |
# Install system dependencies
|
8 |
-
# - Essential for Pillow image processing: libgl1-mesa-glx, libglib2.0-0
|
9 |
-
# - Font handling: fontconfig
|
10 |
-
# - Installs Microsoft Core Fonts (including Arial): ttf-mscorefonts-installer
|
11 |
RUN apt-get update && \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
apt-get install -y --no-install-recommends \
|
13 |
libgl1-mesa-glx \
|
14 |
libglib2.0-0 \
|
@@ -48,8 +53,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
48 |
# Ensure 'appuser' owns these copied files.
|
49 |
COPY --chown=appuser:appuser app.py .
|
50 |
|
51 |
-
# The line to copy 'arial.ttf'
|
52 |
-
# We
|
53 |
|
54 |
# Copy the entire 'templates' directory (and its contents) from your repository root
|
55 |
# to /app/templates inside the container.
|
|
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
7 |
# Install system dependencies
|
|
|
|
|
|
|
8 |
RUN apt-get update && \
|
9 |
+
# Modify sources.list to include contrib and non-free-firmware.
|
10 |
+
# This is necessary for packages like ttf-mscorefonts-installer on Debian Bookworm.
|
11 |
+
# The sed command appends 'contrib non-free-firmware' to lines that already contain 'main'.
|
12 |
+
sed -i 's/main$/main contrib non-free-firmware/g' /etc/apt/sources.list && \
|
13 |
+
# It's also good to ensure security updates are prioritized if specific lines exist for them
|
14 |
+
# sed -i 's/main$/main contrib non-free-firmware/g' /etc/apt/sources.list.d/debian.sources || true && \
|
15 |
+
# Re-run apt-get update to fetch package lists from the newly enabled components
|
16 |
+
apt-get update && \
|
17 |
apt-get install -y --no-install-recommends \
|
18 |
libgl1-mesa-glx \
|
19 |
libglib2.0-0 \
|
|
|
53 |
# Ensure 'appuser' owns these copied files.
|
54 |
COPY --chown=appuser:appuser app.py .
|
55 |
|
56 |
+
# The line to copy 'arial.ttf' was previously REMOVED.
|
57 |
+
# We are relying on the system-installed Arial from 'ttf-mscorefonts-installer'.
|
58 |
|
59 |
# Copy the entire 'templates' directory (and its contents) from your repository root
|
60 |
# to /app/templates inside the container.
|