$ git clone [email protected]:DaisukeShinoku/setting_react_rails.git
$ docker-compose run api rails new . --force --no-deps --database=postgresql --api
$ docker-compose build
$ docker-compose run --rm front sh -c "npm install -g create-react-app && create-react-app . --template typescript"
~
~
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
### 下記を追記
host: db
username: postgres
passowrd:
### 上記を追記
development:
<<: *default
database: docker_qiita_oniki_development
~
~
$ docker-compose up
上記の作業と別のターミナルを立ち上げて行う
$ docker-compose exec api rails db:create
この時点で下記のURLでそれぞれのデフォルトページが表示されることを確認する
- Rails :
http://localhost:3000/
- React :
http://localhost:8000/