ARG DEBIAN_VERSION=bookworm-slim FROM debian:${DEBIAN_VERSION} AS base # Install system dependencies (minimal, only what's needed for the system) RUN apt-get update && apt-get install -y --no-install-recommends \ python3 \ python3-pip \ python3-venv \ python3-dev \ curl \ ca-certificates \ ffmpeg \ sqlite3 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Create virtual environment and install all Python packages RUN python3 -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" ENV PYTHONUNBUFFERED=1 # Install all Python packages in virtual environment RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir \ curl-cffi \ beautifulsoup4 \ pillow \ imagehash \ requests