python alpine base image for image creation

This commit is contained in:
Andre Beging
2025-10-09 11:16:32 +02:00
parent a29ce99420
commit 5c22415ab4
2 changed files with 9 additions and 10 deletions

View File

@@ -1,17 +1,16 @@
# Multi-stage für kleinere finale Imagegröße
FROM python:3.12-slim AS base
# Alpine-basiertes Image für kleinere Größe
FROM python:3.12-alpine AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
# System deps (tzdata optional falls benötigt)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Systemabhängigkeiten installieren (su-exec für Rechtewechsel)
RUN apk add --no-cache ca-certificates su-exec
# Non-root user
RUN useradd -u 10001 -m appuser
RUN addgroup -S appgroup \
&& adduser -S -G appgroup -u 10001 appuser
WORKDIR /app