basic (sqlite)
docker-compose run web bundle exec rails new . --force
db mysql
docker-compose run web bundle exec rails new . --force --database=mysql
api mode
docker-compose run web bundle exec rails new . --force --database=mysql --api
config/database.yml
- password
- host: localhost
+ password: password
+ host: db
docker-compose build
docker-compose up
※ For M1 Mac, use mariadb instead.
docker-compose.yml
- image: mysql:8.0
+ image: mariadb
docker-compose exec web bash
bin/rails db:prepare
use docker-compose.sidekiq.yml
.
Before docker-compose up
, install sidekiq
docker-compose run web bundle add sidekiq