stuff
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -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"]
|
||||
|
Reference in New Issue
Block a user