Heroku Docker Rails

This Rails application is an experiment for exploring Heroku's recently released Docker support.

Dependencies

Development

Run the application locally:

$ docker-compose up

Migrate the database:

$ docker-compose run web bundle exec rails db:migrate

Run another command in a new container:

$ docker-compose run web bundle exec rails console

Open it in your browser:

$ open http://localhost:3000

Deployment

Log in to Heroku:

$ heroku login

Log in to the Container Registry:

$ heroku container:login

Create the application:

$ heroku create heroku-docker-rails

Create the database:

$ heroku addons:create heroku-postgresql:hobby-dev

Build and push the image:

$ heroku container:push web

Migrate the database:

$ heroku run bundle exec rails db:migrate --type web

Open it in your browser:

$ heroku open

Run another command in a new container:

$ heroku run bundle exec rails console --type web