File size: 1,366 Bytes
8722c09
0a7e835
28dce47
d0d0393
 
8722c09
574a255
8722c09
 
 
 
 
 
 
1affc17
 
28dce47
574a255
d47aaad
8722c09
 
 
 
 
 
d47aaad
8722c09
 
 
 
 
0a7e835
574a255
0a7e835
 
 
 
 
 
 
 
2aeb641
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.10-slim

# Set the DEBIAN_FRONTEND to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# 1. Install all base dependencies, including those for xvfb.
RUN apt-get update && apt-get install -y --no-install-recommends \
    wget \
    ca-certificates \
    fontconfig \
    libxext6 \
    libxrender1 \
    xfonts-75dpi \
    xfonts-base \
    xvfb \
    xauth \
    && rm -rf /var/lib/apt/lists/*

# 2. Download and install the required legacy dependencies.
RUN set -ex; \
    wget http://archive.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.2-2+deb10u1_amd64.deb && \
    wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1w-0+deb11u4_amd64.deb && \
    apt-get install -y ./*.deb && \
    rm ./*.deb

# 3. With all dependencies satisfied, download and install wkhtmltox.
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb && \
    apt-get install -y --no-install-recommends ./wkhtmltox_0.12.6-1.buster_amd64.deb && \
    rm ./wkhtmltox_0.12.6-1.buster_amd64.deb && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .

# Ensure the temp directory is writable
RUN mkdir -p /app/temp && chmod -R 777 /app/temp

ENV PORT=7860
CMD ["python", "app.py"]