Skip to content

Instantly share code, notes, and snippets.

@coderoffortune
Created March 23, 2019 16:03
Show Gist options
  • Save coderoffortune/3eb98cb3b7ee874d4559fd9c5ed8c554 to your computer and use it in GitHub Desktop.
Save coderoffortune/3eb98cb3b7ee874d4559fd9c5ed8c554 to your computer and use it in GitHub Desktop.
Simple Dockerfile for dotnet core
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS builder
WORKDIR /build
COPY dotnetapp.csproj .
RUN dotnet restore
COPY . .
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1
WORKDIR /app
COPY --from=builder /build/out .
EXPOSE 5000/tcp
CMD ["dotnet", "dotnetapp.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment