python alpine base image for image creation
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user