Dockernized rails sample app with test using CircleCI and deploy using Heroku
docker-compose up
docker-compose run web rails db:create
docker-compose run web rails db:migrate
docker-compose run web rails test
see https://devcenter.heroku.com/articles/container-registry-and-runtime
# install plugin
heroku plugins:install heroku-container-registry
# login to container registryc
heroku container:login
# create new heroku app
heroku create
# deploy to heroku
heroku container:push web
# attach postgresql addon
heroku addons:create heroku-postgresql:hobby-dev
# db setup
heroku run rails db:migrate
# access to heroku and check /users
heroku open
Set these environment variables to your CircleCI build settings.
HEROKU_AUTH_TOKEN=`heroku auth:token`
HEROKU_LOGIN="your.mail@address.com"
HEROKU_API_KEY=`heroku auth:token`
HEROKU_APP_NAME="your-herokuapp-name"
When git push origin master
CircleCI deploy docker container to heroku container registroy and run rails db:migrate