- docker-compose
- Ruby 2.6.3
- Rails 6.0.0
$ export COMPOSE_FILE=docker-compose.dev.yml
$ docker-compose build --no-cache
$ docker-compose up
$ docker-compose up --build
- Controller Generation
$ docker-compose exec rails_app rails generate controller controller_name
- API Controller Generation
$ docker-compose exec rails_app rails generate controller api::v1::Users index show new create
$ docker-compose exec rails_app rails generate model model_name name:string
- Database initialization
$ docker-compose exec rails_app bundle exec rails db:create db:migrate db:seed
- Database creation
$ docker-compose exec rails_app bundle exec rails db:create
- Database migration
$ docker-compose exec rails_app bundle exec rails db:migrate
- Database seed
$ docker-compose exec rails_app bundle exec rails db:seed
- Remove database
$ docker-compose exec rails_app bundle exec rails db:drop
- Generate Migration
$ docker-compose exec rails_app rails generate migration AddPasswordDigestToUsers password_digest:string
$ docker-compose exec rails_app rails routes
$ docker-compose exec rails_app rails test
$ docker-compose exec rails_app rspec
$ docker exec -it RAILS_APP_CONTAINER_ID /bin/bash
# which vim
# export EDITOR="vim"
# rails credentials:edit