added dockerfile 2

This commit is contained in:
Wieland, Marc
2026-05-22 09:22:47 +02:00
parent 0467f45036
commit 9fd50f86c0
4 changed files with 41 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
**/bin/
**/obj/
**/.vs/
**/.git/
**/node_modules/
*.md
.dockerignore
.gitignore
+31
View File
@@ -0,0 +1,31 @@
# ── 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"]
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("timetracker")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0467f450368a3b05b63a5d2a2cc8779571042711")]
[assembly: System.Reflection.AssemblyProductAttribute("timetracker")]
[assembly: System.Reflection.AssemblyTitleAttribute("timetracker")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
54fcc459703edb8c510de7aeecfdb95fb68c6245b644cb8fff3337f4470f7473
d82bd1af2676da228608191aea963cac3166fa85ba461e9bcfa8554e5f0bdffb