This will build the local Dockerfile:
docker-compose build
This will download images once, then install bundle dependencies:
docker-compose run app --rm bundle install
Modify to suit whatever data initialization your rails project has.
docker-compose run app --rm bundle exec rake db:create db:migrate db:seed
Get the rails app running on the background:
docker-compose up -d
Enter rails console (within running container)
docker-compose exec -ti app bundle exec rails console
To run the test suite:
docker-compose exec -ti app bundle exec rake test # rails 4
docker-compose exec -ti app bundle exec rails test # rails 5
To inspect logs:
docker-compose logs -f
To restart just one container
docker-compose restart app
To stop (but not destroy) the cluster
docker-compose stop
To start (a stopped) cluster
docker-compose start
To destroy the cluster (usefull if config or state gets messed up)
docker-compose down