Skip to content

Instantly share code, notes, and snippets.

@nitharios
Last active October 26, 2018 07:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save nitharios/0462f515a55759b34ee2e1cb152f8073 to your computer and use it in GitHub Desktop.
Save nitharios/0462f515a55759b34ee2e1cb152f8073 to your computer and use it in GitHub Desktop.

Deploying Docker-Compose Container to Heroku

Requirements

Set Up Environment

  1. Generate docker-compose react template
npx compose-it -u <username> -d <project name>
  1. Test docker-compose locally. Check http://localhost:3000
docker-compose up
  1. (optional if already logged in) Log in to Heroku
heroku container:login

Deployment

# app name is optional, heroku will randomly pick a name if no name is given
heroku create [app name]

# build image and push to container registry
heroku container:push <image name>

# release the image to your app
heroku container:release <image name>

# open the app in your browser
heroku open

Updating images

heroku container:push <image name>

Removing images

heroku container:rm <image name>

Troubleshooting

Problem:

heroku container:push <image name>

Error: Missing required flag:
›     -a, --app APP  app to run command against
›   See more help with --help

Solution:

heroku container:push <image name> -a [app name]

Problem:

Invalid auth permission

Solution:

sudo <command>

# OR
docker login

# OR
heroku login

# OR
heroku container:login

Resources

Heroku - Container Runtime & Registry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment