Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +20 -8
Dockerfile
CHANGED
@@ -6,13 +6,25 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|
6 |
|
7 |
# Install system dependencies
|
8 |
RUN apt-get update && \
|
9 |
-
#
|
10 |
-
# This
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
apt-get update && \
|
17 |
apt-get install -y --no-install-recommends \
|
18 |
libgl1-mesa-glx \
|
@@ -67,7 +79,7 @@ USER appuser
|
|
67 |
|
68 |
# Define an environment variable placeholder for the Telegram token.
|
69 |
# The actual token MUST be set in your Hugging Face Space's secrets settings.
|
70 |
-
ENV TELEGRAM_TOKEN="
|
71 |
|
72 |
# Command to run the application when the container launches.
|
73 |
# This executes 'python app.py' as the 'appuser'.
|
|
|
6 |
|
7 |
# Install system dependencies
|
8 |
RUN apt-get update && \
|
9 |
+
# Attempt to modify the newer deb822-style sources file if it exists.
|
10 |
+
# This adds 'contrib' and 'non-free-firmware' to the 'Components' lines.
|
11 |
+
(if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
|
12 |
+
echo "Modifying /etc/apt/sources.list.d/debian.sources to include contrib and non-free-firmware" && \
|
13 |
+
sed -i -e 's/^Components: main$/Components: main contrib non-free-firmware/' \
|
14 |
+
-e 's/^Components: main\( .*\)$/Components: main contrib non-free-firmware\1/' \
|
15 |
+
/etc/apt/sources.list.d/debian.sources; \
|
16 |
+
else \
|
17 |
+
echo "/etc/apt/sources.list.d/debian.sources not found, checking /etc/apt/sources.list"; \
|
18 |
+
fi) && \
|
19 |
+
# Attempt to modify the traditional sources.list file (as a fallback or if it co-exists).
|
20 |
+
# Add '|| true' to prevent failure if the file doesn't exist or sed fails on it.
|
21 |
+
(if [ -f /etc/apt/sources.list ]; then \
|
22 |
+
echo "Modifying /etc/apt/sources.list to include contrib and non-free-firmware" && \
|
23 |
+
sed -i 's/main$/main contrib non-free-firmware/g' /etc/apt/sources.list; \
|
24 |
+
else \
|
25 |
+
echo "/etc/apt/sources.list not found."; \
|
26 |
+
fi || true) && \
|
27 |
+
# Rerun apt-get update with the (potentially) new sources
|
28 |
apt-get update && \
|
29 |
apt-get install -y --no-install-recommends \
|
30 |
libgl1-mesa-glx \
|
|
|
79 |
|
80 |
# Define an environment variable placeholder for the Telegram token.
|
81 |
# The actual token MUST be set in your Hugging Face Space's secrets settings.
|
82 |
+
ENV TELEGRAM_TOKEN=""
|
83 |
|
84 |
# Command to run the application when the container launches.
|
85 |
# This executes 'python app.py' as the 'appuser'.
|