FROM python:3.9-buster ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Install system packages: poppler-utils (for pdf2image) and necessary libs for WeasyPrint. RUN apt-get update && apt-get install -y \ poppler-utils \ libpango-1.0-0 \ libpangocairo-1.0-0 \ libgdk-pixbuf2.0-0 \ libffi-dev \ libcairo2 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r requirements.txt COPY . /app EXPOSE 7860 CMD ["python", "app.py"]