Added Dockerfile
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Kopiere die Projektdatei (.csproj) und lade Abhängigkeiten
|
||||||
|
# Ersetze "DeinProjektName.csproj" evtl. durch "*.csproj", wenn du nur eine hast
|
||||||
|
COPY ../CouchLog/CouchLog.sln ./
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
|
# Kopiere den restlichen Code und baue die App (Release Modus)
|
||||||
|
COPY ../CouchLog/ ./
|
||||||
|
RUN dotnet publish -c Release -o /app/publish
|
||||||
|
|
||||||
|
# --- Phase 2: Ausführen (Runtime Image) ---
|
||||||
|
# Das hier ist das eigentliche Image, das am Ende rauskommt (sehr klein)
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Wir kopieren die fertig gebaute App aus Phase 1 hier rein
|
||||||
|
COPY --from=build /app/publish .
|
||||||
|
|
||||||
|
# WICHTIG: Ersetze "DeinProjektName.dll" mit dem echten Namen deiner DLL!
|
||||||
|
# Der Name ist meistens derselbe wie deine .csproj Datei.
|
||||||
|
ENTRYPOINT ["dotnet", "CouchLog.dll"]
|
||||||
Reference in New Issue
Block a user