Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gambinish/66fc49ebc5fe52a1c7a19dc99df71326 to your computer and use it in GitHub Desktop.
Save gambinish/66fc49ebc5fe52a1c7a19dc99df71326 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>

Resources

Heroku - Container Runtime & Registry

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