FROM debian:12-slim RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y pipx RUN useradd --add-subids-for-system --system --create-home --home-dir /app appuser USER appuser WORKDIR /app ENV PATH /app/.local/bin:$PATH COPY ./requirements.txt /app/requirements.txt RUN pipx install gunicorn==21.2.0 && cat /app/requirements.txt | xargs pipx inject gunicorn COPY ./ /app/ EXPOSE 8080 CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]