added Dockerfile and adapted build.yaml
Some checks failed
.NET Docker Build & Push / build_and_push (push) Failing after 3m53s

This commit is contained in:
2025-12-08 19:18:33 +01:00
parent 86219b0c00
commit c2eed93e7c
2 changed files with 46 additions and 17 deletions

27
CouchLog/Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# --- Stufe 1: Bauen (Build) ---
# Wir nutzen das SDK Image. Da du auf dem Pi bist, zieht Docker automatisch die ARM64 Version.
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Wir kopieren erst nur die Projektdatei, um den Cache für "restore" zu nutzen
# ERSETZE "DeinProjektName.csproj" mit dem echten Namen deiner Datei!
COPY ["DeinProjektName.csproj", "./"]
RUN dotnet restore
# Jetzt den Rest kopieren und bauen
COPY . .
# Wir erstellen die Release-Version im Ordner /app/publish
RUN dotnet publish -c Release -o /app/publish
# --- Stufe 2: Ausführen (Runtime) ---
# Kleines Image, nur um die App zu starten (kein Compiler mehr drin)
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
EXPOSE 8080
# Wir kopieren die fertigen Dateien aus Stufe 1 hierher
COPY --from=build /app/publish .
# Startbefehl
# ERSETZE "DeinProjektName.dll" mit dem echten Namen (meist gleich wie csproj)
ENTRYPOINT ["dotnet", "CouchLog.dll"]