Docker container build on top of Evil Martians ideas: https://evilmartians.com/chronicles/ruby-on-whales-docker-for-ruby-rails-development
Suite includes:
- Rails 6.1
- Ruby 3.0.0-rc1
- PostgreSQL
- Sidekiq + Redis
cp .env.example .env
docker-compose build
docker-compose run runner bundle install
docker-compose run runner yarn install
docker-compose run runner bundle exec rake db:create db:migrate db:seed
docker-compose up -d
Then just open in web browser:
http://localhost:3000
File .env contains smtp settings of email for testing. You can fill in the file with your smtp settings
To run all rspec test do
docker-compose exec runner bundle exec rake db:create db:migrate db:seed RAILS_ENV=test
docker-compose exec runner rspec
Open ./coverage/index.html to see coverage results report (100.0% covered at 1.5 hits/line).
Mails are sent through Sidekiq, the queue of jobs can be viewed on http://localhost:3000/sidekiq
Сode analyzer Rubocop was used, you can see it report
docker-compose exec runner rubocop --require rubocop-rails
Log in page