Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Wie fügt man eine Asp C# .Net Web API in Docker hinzu

08.03.2023 (👁2672)


Hierzu fügt man eine Datei mit dem Namen Dockerfile hinzu

Zuvor sollte man in Visual Code die Docker Extension hinzugefügt haben

Ein Bild, das Text, Monitor, Screenshot, schwarz enthält.

Automatisch generierte Beschreibung

Dann fügt man folgende Commands in die Dockerfile.

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env

WORKDIR /app

 

COPY *.csproj ./

RUN dotnet restore

 

COPY . ./

RUN dotnet publish -c Release -o out

 

FROM mcr.microsoft.com/dotnet/aspnet:7.0

WORKDIR /app

COPY --from=build-env /app/out .

 

ENTRYPOINT [ "dotnet","PlatformService.dll" ]

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung