Spaces:
Running
Running
| # 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"] | |