Files
timetracker/Dockerfile
T
2026-05-22 09:22:47 +02:00

32 lines
1.2 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ── Build Stage ──────────────────────────────────────────────────────────────
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY timetracker/timetracker.csproj timetracker/
RUN dotnet restore timetracker/timetracker.csproj
COPY timetracker/ timetracker/
WORKDIR /src/timetracker
RUN dotnet publish -c Release -o /app/publish --no-restore
# ── Runtime Stage ─────────────────────────────────────────────────────────────
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
COPY --from=build /app/publish .
# Verzeichnis für die SQLite-Datenbank (als Volume mounten für Persistenz)
RUN mkdir -p /data
# HTTP auf Port 8080, HTTPS wird vom Reverse Proxy (z.B. nginx/Traefik) übernommen
ENV ASPNETCORE_HTTP_PORTS=8080
ENV ASPNETCORE_ENVIRONMENT=Production
ENV TIMETRACKER_DB_PATH=/data/timetracker.db
ENV EnableHttpsRedirect=false
EXPOSE 8080
# Datenbank-Volume außerhalb mounten, damit sie Container-Neustarts überlebt
VOLUME ["/data"]
ENTRYPOINT ["dotnet", "timetracker.dll"]