File size: 1,343 Bytes
fb43ab0
 
 
c001f24
fb43ab0
 
c001f24
 
 
 
0a9b593
c001f24
18acfd2
fb43ab0
 
 
 
 
 
 
 
 
 
 
c001f24
 
fb43ab0
 
 
 
 
c001f24
 
 
39138b5
c001f24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
# 1. Use 'bullseye' explicitly. 
# The default 'slim' is now Bookworm (Debian 12), which has dropped support for the older wkhtmltopdf dependencies.
FROM python:3.11-slim-bullseye

# 2. Install dependencies
# We include 'xfonts-75dpi' and 'xfonts-base' which are crucial for wkhtmltopdf
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    curl \
    libgl1 \
    libglib2.0-0 \
    wget \
    fontconfig \
    libfreetype6 \
    libjpeg62-turbo \
    libpng16-16 \
    libx11-6 \
    libxext6 \
    libxrender1 \
    libxft2 \
    libfontconfig1 \
    xfonts-base \
    xfonts-75dpi \
    && rm -rf /var/lib/apt/lists/*

# 3. Download the specific package for BULLSEYE (Debian 11), not Jammy (Ubuntu)
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb -O /tmp/wkhtmltox.deb \
    && apt-get install -f -y /tmp/wkhtmltox.deb \
    && rm -rf /tmp/wkhtmltox.deb

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir gunicorn eventlet huggingface_hub[cli]
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
RUN chmod +x entrypoint.sh

RUN useradd -m -u 1000 user
RUN chown -R user:user /app
USER user
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH

ENV PORT=7680
ENV PYTHONUNBUFFERED=1

EXPOSE 7680

CMD ["./entrypoint.sh"]