Rootless User konfigurierbar + Doku
This commit is contained in:
@@ -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 .
|
||||
|
||||
Reference in New Issue
Block a user