understanding commited on
Commit
ad1707c
·
verified ·
1 Parent(s): 3cd967e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -8
Dockerfile CHANGED
@@ -6,13 +6,25 @@ 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 \
@@ -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="7229558358:AAH_btIdtnJvfGhh84O2uVa8wuH88ShUcy0"
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'.