Lucy Dockerunner
Lucy Dockerunner is a Ruby gem that provides a simple wrapper around the Docker Compose CLI to make it easier to run Docker Compose commands from ruby projects.
Ruby version: >= 2.6.0
This gem version: 0.2.0
Dependencies
Files
The default file is set to docker-compose.yml, but you can change it setting the LUCY_FILE environment variable.
Services
Check services in compose.rake file.
Installation
You can install the gem by executing:
$ gem install lucy_dockerunner
Or add it to your Gemfile:
gem 'lucy_dockerunner'
Usage
If you want to use superuser privileges, you can set the LUCY_SU with your superuser command, for example:
$ export LUCY_SU="sudo"
Or use .env file:
LUCY_SU="sudo"
Add the following code to your Rakefile to load the tasks
require 'lucy_dockerunner'
LucyDockerunner.load_tasks
Docker actions(more services in compose.rake file)
rake compose:install- build docker compose and migrate the databaserake compose:build- build docker compose servicesrake compose:up- start the docker compose servicesrake compose:down- stop the docker compose servicesrake compose:status- show the status of the docker compose servicesrake compose:shell- open a shell in the web servicerake compose:db_detach- detach the database from the docker compose servicesrake compose:redis_detach- detach the redis from the docker compose servicesrake compose:back_detach- detach the backend(redis, sidekiq, db) from the docker compose servicesrake compose:restart- restart the docker compose servicesrake compose:clean_all- clean all docker compose servicesrake compose:clean_images- clean all docker compose imagesrake compose:clean_volumes- clean all docker compose volumesrake compose:clean_orphans- clean all docker compose orphansrake compose:clean_containers- clean all docker compose containers
Database actions
rake compose_db:migrate- migrate the databaserake compose_db:reset- reset the databaserake compose_db:drop- drop the databaserake compose_db:create- create the databaserake compose_db:seed- seed the databaserake compose_db:rollback- rollback the databaserake compose_db:setup- setup the databaserake compose_db:complete_setup- complete setup the databaserake compose_db:reset_setup- drop and setup the databaserake compose_db:reset- reset the database
Tests actions
rake compose_test:all- run all testsrake compose_test:clean_all- run all tests after cleaning docker compose servicesrake compose_test:controllers- run controllers testsrake compose_test:models- run models testsrake compose_test:requests- run requests testsrake compose_test:helpers- run helpers testsrake compose_test:mailers- run mailers testsrake compose_test:routing- run routing testsrake compose_test:views- run views tests
LOGS actions
rake compose_logs:web- show web logsrake compose_logs:db- show db logsrake compose_logs:redis- show redis logsrake compose_logs:sidekiq- show sidekiq logsrake compose_logs:all- show all logsrake compose_logs:tail_web- tail web logsrake compose_logs:tail_db- tail db logsrake compose_logs:tail_redis- tail redis logsrake compose_logs:tail_sidekiq- tail sidekiq logsrake compose_logs:tail_all- tail all logs
Assets actions
rake compose_assets:precompile- precompile assetsrake compose_assets:clean- clean assetsrake compose_assets:clobber- clobber assets
Start the docker compose services
$ rake compose:up
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/JesusGautamah/lucy_dockerunner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
/ Recent activity 
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the LucyDockerunner project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.