Deploying Suave to Heroku with Docker
Heroku does not have an official buildpack for the .NET runtime.
So, You can choose to Deploying with Docker.
Furthermore, when combined with Creating Single-file on .NET Core 3.0, we can deploy and launch apps just by creating an environment based on a simple Alpine Docker image.
The sample GitHub repository.
https://github.com/dyoshikawa/heroku-suave-getting-started
-
Create standalone single file from sources:
dotnet publish -c Release -r linux-musl-x64 /p:PublishSingleFile=true /p:PublishTrimmed=true
-
Install the Heroku Toolbelt and login to Heroku using the command-line tools:
heroku login heroku container:login
-
Clone the sample:
git clone https://github.com/dyoshikawa/heroku-suave-getting-started cd heroku-suave-getting-started
-
Create a new heroku web app and register “heroku” as a remote you can push to:
heroku create
-
Deploy app to Heroku:
heroku container:push web heroku container:release web
-
Browse app:
heroku open