Last active
January 30, 2020 06:33
-
-
Save curiousape-ph/a6110fa37e511c484545ac7942c5c861 to your computer and use it in GitHub Desktop.
Dotnet Core 3.1.1 DockerFIle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use Microsoft's official build .NET image. | |
| # https://hub.docker.com/_/microsoft-dotnet-core-sdk/ | |
| FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build | |
| WORKDIR /app | |
| # Install production dependencies. | |
| # Copy csproj and restore as distinct layers. | |
| COPY *.csproj ./ | |
| RUN dotnet restore | |
| # Copy local code to the container image. | |
| COPY . ./ | |
| WORKDIR /app | |
| # Build a release artifact. | |
| RUN dotnet publish -c Release -o out | |
| # Use Microsoft's official runtime .NET image. | |
| # https://hub.docker.com/_/microsoft-dotnet-core-aspnet/ | |
| FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine AS runtime | |
| WORKDIR /app | |
| COPY --from=build /app/out ./ | |
| # Run the web service on container startup. | |
| ENTRYPOINT ["dotnet", "cloud-run-dotnetcore-31.dll"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment