From fb331361bd2bc9e80296519afd90470d08cbec28 Mon Sep 17 00:00:00 2001 From: MaxD3mage Date: Tue, 17 Sep 2024 16:54:45 +0500 Subject: [PATCH] completed task Dockerfile --- Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2892cff --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base +WORKDIR /WebApp +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /WebApp +COPY . . +RUN dotnet restore WebApp/WebApp.csproj + +RUN dotnet build WebApp/WebApp.csproj -c Release -o /App + +FROM build AS publish +WORKDIR /WebApp +RUN dotnet publish WebApp/WebApp.csproj -c Release -o /App + +FROM base AS final +WORKDIR /WebApp +COPY --from=publish /App . +ENTRYPOINT ["dotnet", "WebApp.dll"] + + + + +