問題
一度docker-composeで立ち上げて消すとtmp/pids/server.ipd
が残るっぽいので、
こいつを消し去りたい。
$ docker-compose up
web_api_1 | A server is already running. Check /app/tmp/pids/server.pid.
web_api_1 | => Booting WEBrick
web_api_1 | => Rails 5.0.6 application starting in development on http://0.0.0.0:3000
web_api_1 | => Run `rails server -h` for more startup options
web_api_1 | Exiting
解決
docker-compose.yml
の設定でserver.ipd
を消し去るコマンドを流すようにする。
version: '3'
services:
web_api:
build: .
# もともとの設定
# command: bundle exec rails s -p 3000 -b '0.0.0.0'
command: /bin/sh -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/app
ports:
- "3000:3000"