Dockerfile aktualisiert
This commit is contained in:
+6
-8
@@ -2,11 +2,11 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY timetracker/timetracker.csproj timetracker/
|
||||
RUN dotnet restore timetracker/timetracker.csproj
|
||||
# Keine Unterordner mehr beim Kopieren!
|
||||
COPY timetracker.csproj ./
|
||||
RUN dotnet restore timetracker.csproj
|
||||
|
||||
COPY timetracker/ timetracker/
|
||||
WORKDIR /src/timetracker
|
||||
COPY . ./
|
||||
RUN dotnet publish -c Release -o /app/publish --no-restore
|
||||
|
||||
# ── Runtime Stage ─────────────────────────────────────────────────────────────
|
||||
@@ -14,10 +14,9 @@ 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)
|
||||
# Verzeichnis für die SQLite-Datenbank
|
||||
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
|
||||
@@ -25,7 +24,6 @@ ENV EnableHttpsRedirect=false
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
# Datenbank-Volume – außerhalb mounten, damit sie Container-Neustarts überlebt
|
||||
VOLUME ["/data"]
|
||||
|
||||
ENTRYPOINT ["dotnet", "timetracker.dll"]
|
||||
ENTRYPOINT ["dotnet", "timetracker.dll"]
|
||||
Reference in New Issue
Block a user