rails-template

Environments

  • Ruby: 3.1.2
  • Rails: 7.0.4
  • MySQL: 8.0.31
  • Redis: 7.0.x

Setup

cp .env.example .env
rm config/credentials.yml.enc

docker compose build
docker compose run app sh

# on app container
EDITOR=vi rails credentials:edit
exit

docker compose up
docker compose exec app sh

# on app container
rails db:setup

Style guide

Commands

# Test (Rspec)
bundle exec rspec

# Lint (Rubocop)
bundle exec rubocop
bundle exec rubocop -a # Auto fix