Skip to content

Instantly share code, notes, and snippets.

@kyle-morton
Created August 15, 2020 19:21
Show Gist options
  • Save kyle-morton/c917bdfb027b1c7818e980361aa67b53 to your computer and use it in GitHub Desktop.
Save kyle-morton/c917bdfb027b1c7818e980361aa67b53 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-1909 AS base
WORKDIR /app
EXPOSE 5000
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1909 AS build
WORKDIR /src
COPY ["docker-mvc.csproj", "./"]
RUN dotnet restore "./docker-mvc.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "docker-mvc.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "docker-mvc.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "docker-mvc.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment