CodeStyle, Compose verbesserungen, Docker Healthcheck

This commit is contained in:
2025-11-17 00:44:10 +01:00
parent 8a753ca9ba
commit 2576604a4a
23 changed files with 861 additions and 221 deletions

View File

@@ -18,19 +18,29 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0
# Build-Argument für Version (wird zur Build-Zeit vom CI/CD gesetzt)
ARG VERSION=latest
# 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
WORKDIR /app
COPY --from=build /app/publish .
# Stelle sicher, dass Verzeichnisse existieren
RUN mkdir -p /app/persistence /app/wwwroot/downloads/sqlite /app/logs
# Stelle sicher, dass Verzeichnisse existieren und Berechtigungen gesetzt sind
RUN mkdir -p /app/persistence /app/wwwroot/downloads/sqlite /app/logs && \
chown -R watcher:watcher /app
# Volumes
VOLUME ["/app/persistence", "/app/wwwroot/downloads/sqlite", "/app/logs"]
# Switch to non-root user
USER watcher
# Expose Port 5000
EXPOSE 5000
ENV ASPNETCORE_URLS=http://*:5000
ENV ASPNETCORE_ENVIRONMENT=Development
ENV ASPNETCORE_ENVIRONMENT=Production
# Version als Environment Variable setzen
ENV WATCHER_VERSION=${VERSION}