steps
github登録前の手順
- mkdir rails_typescript_example2
- cd rails_typescript_example2
- git init
- git commit --allow-empty -m "init"
- git remote add origin HEAD
- git push -u origin HEAD
Dockerfile関連のファイルを作成する
Gemfileの作成
- docker-compose run --rm app bundle init
[add Gemfile](https://github.com/gendosu/rails_typescript_example2/commit/de2bd9d1bc2e426cbc1538 - Gemfileにgem 'rails'をを追加
bundle install実行
- docker-compose run --rm app bundle install
bundle install
dockerコンテナの設定
dockerコンテナ起動
- docker-compose up app
別のコンソールでdockerコンテナに接続して作業
以下の作業内容
rails new rails_typescript_example2 --database=postgresql --webpack=react
- docker-compose exec app bash
- docker-compose exec app bundle exec rails new rails_typescript_example2 --database=postgresql --webpack=react
- rm -rf rails_typescript_example2/.git ※権限がない場合はsudoをつける
- rm -rf rails_typescript_example2/README.md
- cp -pr rails_typescript_example2/* rails_typescript_example2/.gitignore rails_typescript_example2/.ruby-version rails_typescript_example2/.gitattributes .
rails起動
- docker-compose exec rails s