ASP.NET Core and Heroku - Dockerfile - https://codingblast.com/hosting-asp-net-core-on-heroku-with-dockercircleci-for-free/
This file contains 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
FROM microsoft/dotnet:2.2-sdk AS build-env | |
WORKDIR /app | |
# Copy csproj and restore as distinct layers | |
COPY *.csproj ./ | |
RUN dotnet restore | |
# Copy everything else and build | |
COPY . ./ | |
RUN dotnet publish -c Release -o out | |
# Build runtime image | |
FROM microsoft/dotnet:2.2-aspnetcore-runtime | |
WORKDIR /app | |
COPY --from=build-env /app/out . | |
CMD dotnet AspNetCoreHerokuDocker.dll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment