Rootless User konfigurierbar + Doku

This commit is contained in:
2025-11-19 14:21:22 +01:00
parent 1aab81a7fc
commit a7ca1214f3
5 changed files with 408 additions and 158 deletions

View File

@@ -18,11 +18,15 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0
# Build-Argument für Version (wird zur Build-Zeit vom CI/CD gesetzt)
ARG VERSION=latest
# Build-Argumente für UID/GID (Standard: 1000)
ARG USER_UID=1000
ARG USER_GID=1000
# Install curl for health checks
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN groupadd -r watcher -g 1000 && useradd -r -g watcher -u 1000 watcher
# Create non-root user with configurable UID/GID
RUN groupadd -r watcher -g ${USER_GID} && useradd -r -g watcher -u ${USER_UID} watcher
WORKDIR /app
COPY --from=build /app/publish .