Skip to content

Instantly share code, notes, and snippets.

@msveden
Last active November 3, 2019 09:31
Show Gist options
  • Save msveden/d951d70371688bd3884e5582183dbbfa to your computer and use it in GitHub Desktop.
Save msveden/d951d70371688bd3884e5582183dbbfa to your computer and use it in GitHub Desktop.
How to deploy a dotnet core 3 web app on Heroku

Create a Docker file in the app root with this content:

#Grab the latest alpine image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0

# Add our code
ADD ./bin/Release/netcoreapp3.0/ /app
WORKDIR /app

CMD ASPNETCORE_URLS=http://*:$PORT dotnet [name of the dll].dll

Add git targets by:

heroku create [optionally a name here]

Push new version

heroku container:push web

Release

heroku container:release web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment