Skip to content

Instantly share code, notes, and snippets.

@namhnz
Created August 17, 2019 16:30
Show Gist options
  • Save namhnz/7d3c9b973d8a300ce2c805831e18f561 to your computer and use it in GitHub Desktop.
Save namhnz/7d3c9b973d8a300ce2c805831e18f561 to your computer and use it in GitHub Desktop.
# from http://blog.federicosilva.net/, updated to support dotnet core 2.2
# reference from https://codingblast.com/hosting-asp-net-core-on-heroku-with-dockercircleci-for-free/
# build image
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
# runtime image
FROM microsoft/dotnet:2.2-aspnetcore-runtime
ENV PORT=5000
WORKDIR /app
COPY --from=build /app/out .
CMD ASPNETCORE_URLS=http://*:$PORT dotnet Daycare.dll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment