Dockerizing Ruby On Rails And Everyday Tasks In Containers
dockerizing ruby on rails app continues with everyday tasks in containers. run rake tasks & rails commands using `docker-compose` like `$ docker-compose run web rails routes`. tip: create custom scripts/aliases for repetitive tasks.
The last episode was about dockerizing our Ruby on Rails app. In this episode, we’ll be exploring how to perform everyday tasks in our containers. Running rake tasks and rails commands Running rake tasks is easy. Once you’ve built your images, you can use docker-compose to run commands in them. For example, if you want to see the routes of your app: $ docker-compose run web rails routes Similarly, if you want to create the db, migrate, and seed: $ docker-compose run web rails db:create db:migrate db:seed If, instead, you want to run your test suite, you’ll have to create the test db: $ docker-...