Skip to content

Instantly share code, notes, and snippets.

@EmpeRoar
Created August 25, 2023 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmpeRoar/24884b88016b5a77f98b256150db08f6 to your computer and use it in GitHub Desktop.
Save EmpeRoar/24884b88016b5a77f98b256150db08f6 to your computer and use it in GitHub Desktop.
dockerfile
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 ["bank.csproj", ""]
RUN dotnet restore "bank.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet build "bank.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "bank.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "bank.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment