broadfield-dev commited on
Commit
fb2ad16
·
verified ·
1 Parent(s): 37aaf51

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -4,21 +4,26 @@ FROM python:3.9-slim
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Update package lists and install ALL necessary system dependencies for wkhtmltopdf
8
- # This now includes the ones that caused the previous error, resolving the dpkg failure.
 
 
 
 
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  wget \
11
  fontconfig \
12
  libjpeg62-turbo \
13
- libssl1.1 \
14
  libxext6 \
15
  xfonts-75dpi \
16
  xfonts-base \
17
  libxrender1 \
 
 
18
  && apt-get clean \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
- # Now, download and install the package. It will succeed because its dependencies are present.
22
  RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb && \
23
  dpkg -i wkhtmltox_0.12.6-1.buster_amd64.deb && \
24
  rm wkhtmltox_0.12.6-1.buster_amd64.deb
@@ -30,7 +35,7 @@ COPY app.py .
30
  # Install the Python dependencies
31
  RUN pip install --no-cache-dir -r requirements.txt
32
 
33
- # Expose the port that Flask will run on (matches app.py)
34
  EXPOSE 7860
35
 
36
  # The command to start your Flask application when the container launches
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # CRITICAL FIX: The wkhtmltox package requires libssl1.1, which is not in the new Debian repos.
8
+ # We must manually add the repository for the older Debian "Buster" release to find this package.
9
+ RUN echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/sources.list
10
+
11
+ # Update the package lists to include the newly added "Buster" repository.
12
+ # Then, install all necessary dependencies. apt will now be able to find libssl1.1.
13
  RUN apt-get update && apt-get install -y --no-install-recommends \
14
  wget \
15
  fontconfig \
16
  libjpeg62-turbo \
 
17
  libxext6 \
18
  xfonts-75dpi \
19
  xfonts-base \
20
  libxrender1 \
21
+ # This will now succeed because we added the buster repo
22
+ libssl1.1 \
23
  && apt-get clean \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
+ # Now that all dependencies are present, download and install the wkhtmltox package.
27
  RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb && \
28
  dpkg -i wkhtmltox_0.12.6-1.buster_amd64.deb && \
29
  rm wkhtmltox_0.12.6-1.buster_amd64.deb
 
35
  # Install the Python dependencies
36
  RUN pip install --no-cache-dir -r requirements.txt
37
 
38
+ # Expose the port that Flask will run on
39
  EXPOSE 7860
40
 
41
  # The command to start your Flask application when the container launches