Replace python:3.12-slim (Debian) with python:3.12-alpine to reduce image size and eliminate 68 Debian-inherited CVEs. Upgrade pip to resolve CVE-2025-8869. Build deps installed temporarily for native extensions (cryptography) and removed after pip install. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
455 B
Docker
21 lines
455 B
Docker
FROM python:3.12-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN apk add --no-cache --virtual .build gcc musl-dev libffi-dev openssl-dev && \
|
|
pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt && \
|
|
apk del .build
|
|
|
|
COPY src/ /app/src/
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONPATH=/app/src
|
|
|
|
VOLUME /data
|
|
|
|
ENTRYPOINT ["python", "-m", "bouncer"]
|
|
CMD ["-c", "/data/bouncer.toml"]
|