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の作成

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