Settings for running Rails on Docker are written.
module Myapp
↓ rename to
module YourRepositoryName
You need an environment that can run docker-compose. https://docs.docker.com/compose/install/
docker-compose run -e EDITOR="vi" rails rails credentials:edit
System | Version |
---|---|
Ruby | 3.0.1 |
bundler | 2.2.17 |
Rails | 6.1.3.2 |
MySQL | 5.7 |
docker-compose | 3 |
- etc...
- nodejs, yarn
- GitHub Actions
- webpacker
- heroku
- rspec tools
- rubocop tools
docker-compose build
- build rails and mysql docker
docker-compose up
- up rails and mysql docker
Although react and vue are not included, webpacker is included, so you can install react and vue with the following command.
# install react
$ docker-compose run rails bundle exec rails webpacker:install:react
$ docker-compose run rails bundle exec rails generate react:install
# install vue
$ docker-compose run rails bundle exec rails webpacker:install:vue
$ docker-compose run rails bundle exec rails generate react:vue
docker-compose run rails bundle exec rails db:create
docker-compose run rails bundle exec rubocop
docker-compose run rails bundle exec rspec
- Nothing
$ brew tap heroku/brew && brew install heroku
$ heroku login
$ heroku create app_name
$ heroku addons:add cleardb
$ zsh
$ heroku_cleardb=`heroku config:get CLEARDB_DATABASE_URL`
$ heroku_cleardb=mysql2${heroku_cleardb:5}
$ heroku config:set DATABASE_URL=$heroku_cleardb
$ heroku config:set RAILS_MASTER_KEY=`cat config/master.key`