Skip to content

Instantly share code, notes, and snippets.

@richlander
Last active November 17, 2020 21:03
Show Gist options
  • Save richlander/4be82f104e5323cca8493eb35a3ea773 to your computer and use it in GitHub Desktop.
Save richlander/4be82f104e5323cca8493eb35a3ea773 to your computer and use it in GitHub Desktop.
.NET Core 3.0 Preview 3 Dockerfile
FROM mcr.microsoft.com/dotnet/core/runtime:3.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
WORKDIR /src
COPY ["WebApplication4/WebApplication4.csproj", "WebApplication4/"]
RUN dotnet restore "WebApplication4/WebApplication4.csproj"
COPY . .
WORKDIR "/src/WebApplication4"
RUN dotnet build "WebApplication4.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "WebApplication4.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "WebApplication4.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment