Files
watcher/Dockerfile
2025-06-15 13:00:19 +02:00

26 lines
634 B
Docker

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