This commit is contained in:
2025-06-15 13:00:19 +02:00
parent b3902d971c
commit f362dc9e3a
9 changed files with 389 additions and 15 deletions

View File

@@ -1,22 +1,25 @@
# Build-Stage
# 1. Build-Phase: SDK-Image
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
# Projektdateien kopieren und Abhängigkeiten wiederherstellen
COPY *.csproj ./
COPY *.sln .
COPY Watcher/*.csproj ./Watcher/
RUN dotnet restore
# Restlichen Code kopieren und veröffentlichen
COPY . ./
RUN dotnet publish -c Release -o out
# Restliche Dateien kopieren und Build ausführen
COPY Watcher/. ./Watcher/
WORKDIR /app/Watcher
RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false
# Runtime-Stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
# 2. Laufzeit-Phase: ASP.NET Core Runtime
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY --from=build /app/publish .
COPY --from=build /app/out ./
EXPOSE 5000
EXPOSE 5001
# Exponiere Port 80 und 443 (HTTP + HTTPS)
EXPOSE 80
EXPOSE 443
# Anwendung starten
ENTRYPOINT ["dotnet", "Watcher.dll"]