Last active
May 17, 2020 23:16
-
-
Save bhdryrdm/b844198109a21659029a7a26f8338735 to your computer and use it in GitHub Desktop.
Heroku Aspnet Dockerfile
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 mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env | |
EXPOSE 80 | |
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 mcr.microsoft.com/dotnet/core/aspnet:3.1 | |
WORKDIR /app | |
COPY --from=build-env /app/out . | |
CMD ASPNETCORE_URLS=http://*:$PORT dotnet Heroku.dll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment