docker-compose.yml
version: '3' services: db: image: postgres volumes: - ./tmp/db:/var/lib/postgresql/data web: build: . command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" volumes: - .:/myapp ports: - "3000:3000" depends_on: - db
Dockerfile
FROM ruby:2.5 RUN apt-get update -qq && apt-get install -y nodejs postgresql-client RUN mkdir /myapp WORKDIR /myapp COPY Gemfile /myapp/Gemfile COPY Gemfile.lock /myapp/Gemfile.lock RUN bundle install COPY . /myapp # Add a script to be executed every time the container starts. COPY entrypoint.sh /usr/bin/ RUN chmod +x /usr/bin/entrypoint.sh ENTRYPOINT ["entrypoint.sh"] EXPOSE 3000 # Start the main process. CMD ["rails", "server", "-b", "0.0.0.0"]
Railsでのweb開発をDockerのコンテナ上で行なっているのですが、docker-compose upを実行すると以下のように表示されて、すぐに落ちてしまいます。(問題が有るであろう部分のみ表示しています。)
terateil:app terateil$ docker-compose up app_db_1 is up-to-date Starting app_web_1 ... done Attaching to app_db_1, app_web_1 db_1 | 2019-02-12 05:05:04.358 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1 | 2019-02-12 05:05:04.358 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1 | 2019-02-12 05:05:04.363 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2019-02-12 05:05:04.524 UTC [24] LOG: database system was interrupted; last known up at 2019-02-12 04:52:18 UTC db_1 | 2019-02-12 05:05:11.983 UTC [24] LOG: database system was not properly shut down; automatic recovery in progress db_1 | 2019-02-12 05:05:12.121 UTC [24] LOG: redo starts at 0/168B928 db_1 | 2019-02-12 05:05:12.122 UTC [24] LOG: invalid record length at 0/168B960: wanted 24, got 0 db_1 | 2019-02-12 05:05:12.122 UTC [24] LOG: redo done at 0/168B928 db_1 | 2019-02-12 05:05:12.459 UTC [1] LOG: database system is ready to accept connections web_1 | /usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:314:in `block (2 levels) in check_controller_and_action': '' is not a supported controller name. This can lead to potential routing problems. See http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use (ArgumentError) web_1 | from /usr/local/bundle/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load' web_1 | from /usr/local/bundle/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>' web_1 | from /myapp/bin/spring:15:in `require' web_1 | from /myapp/bin/spring:15:in `<top (required)>' web_1 | from bin/rails:3:in `load' web_1 | from bin/rails:3:in `<main>' web_1 | => Booting Puma web_1 | => Rails 5.2.2 application starting in development web_1 | => Run `rails server -h` for more startup options web_1 | Exiting app_web_1 exited with code 1
捕捉:tmp/pids/server.pidファイルは生成されていません。
どなたか解決方法がわかる方ご教授頂けたら幸いです。

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。
2019/02/12 08:49