Skip to content

Instantly share code, notes, and snippets.

@OksanaH
Created December 29, 2020 15:45
Show Gist options
  • Save OksanaH/d8460c133368d452a889920d66aa1496 to your computer and use it in GitHub Desktop.
Save OksanaH/d8460c133368d452a889920d66aa1496 to your computer and use it in GitHub Desktop.
Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app
EXPOSE 80
# Copy csproj and restore as distinct layers
COPY *.csproj ./
COPY *.config ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "RandomNumber.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment