# Lightweight Python base FROM python:3.12-slim ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_ROOT_USER_ACTION=ignore # Install only essential system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl gnupg tzdata \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # --- Python dependencies --- COPY requirements.txt . RUN --mount=type=cache,target=/root/.cache/pip \ pip install --no-cache-dir -r requirements.txt # --- Copy app code --- COPY app/ /app/ # Stay root or not USER root ENTRYPOINT ["python", "/app/main.py"]