From 31b47e2fedeb7ac9a5b63a60d237d13f984827a7 Mon Sep 17 00:00:00 2001 From: "Mr.Z" <8897323@qq.com> Date: Fri, 17 Feb 2023 14:51:11 +0000 Subject: [PATCH] add Dockerfile. Signed-off-by: Mr.Z <8897323@qq.com> --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c990c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["BlazorApp1/BlazorApp1.csproj", "BlazorApp1/"] +RUN dotnet restore "BlazorApp1/BlazorApp1.csproj" +COPY . . +WORKDIR "/src/BlazorApp1" +RUN dotnet build "BlazorApp1.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "BlazorApp1.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "BlazorApp1.dll"] \ No newline at end of file -- Gitee