In this tutorial, we will try to deploy NGINX on Heroku with Docker. For your information, Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud.

I have created muhammadhanif/heroku-nginx-docker-container git repository. We will use the repository to deploy nginx docker container.

Before you execute the following instructions, you have to have Heroku account and on your computer you have to install these softwares:

  1. Git
  2. Docker
  3. Heroku CLI

Here are the steps to deploy NGINX on Heroku with Docker:

git clone https://github.com/muhammadhanif/heroku-nginx-docker-container.git
cd heroku-nginx-docker-container
heroku login
heroku container:login

Change APP_NAME with the name of your Heroku app.

heroku container:push web -a APP_NAME
heroku container:release web -a APP_NAME

By using browser, access to your Heroku app domain.

The other way to deploy muhammadhanif/heroku-nginx-docker-container git repository to Heroku is by clicking the following button. This is the simpler way to deploy.