Railsで開発したアプリをDocker+Herokuでデプロイしたいのですがエラーが出て、自己解決できません。
どのようにしたら良いでしょうか?よろしくお願い致します。
heroku log
2019-09-18T21:52:10.087691+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=thawing-badlands-20439.herokuapp.com request_id=ca0131aa-602f-48e3-ac0d-31e6706cfa03 fwd="36.12.110.121" dyno=web.1 connect=1ms service=1365ms status=503 bytes=0 protocol=https
Docker file
FROM ruby:2.6.3 RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ && apt-get install -y nodejs RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client RUN mkdir /myapp WORKDIR /myapp ADD Gemfile /myapp/Gemfile ADD Gemfile.lock /myapp/Gemfile.lock RUN bundle install COPY . /myapp CMD ["rails", "server", "-b", "0.0.0.0"]
Docker-compose.yml
version: '3' services: db: image: postgres:11.2 ports: - '5432:5432' volumes: - postgresql-data:/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 volumes: postgresql-data: driver: local
デプロイしたコマンド
docker-compose build #起動することを確認 docker-compose up -d #herokuへデプロイ heroku container:login heroku create heroku container:push web heroku addons:create heroku-postgresql:hobby-dev heroku run rails db:migrate heroku container:release web #credential fileを利用しているため環境変数にmaster.keyを設定 heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
あなたの回答
tips
プレビュー