質問編集履歴
4
デプロイ方法
test
CHANGED
File without changes
|
test
CHANGED
@@ -91,3 +91,37 @@
|
|
91
91
|
driver: local
|
92
92
|
|
93
93
|
```
|
94
|
+
|
95
|
+
デプロイしたコマンド
|
96
|
+
|
97
|
+
```
|
98
|
+
|
99
|
+
docker-compose build
|
100
|
+
|
101
|
+
#起動することを確認
|
102
|
+
|
103
|
+
docker-compose up -d
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
#herokuへデプロイ
|
108
|
+
|
109
|
+
heroku container:login
|
110
|
+
|
111
|
+
heroku create
|
112
|
+
|
113
|
+
heroku container:push web
|
114
|
+
|
115
|
+
heroku addons:create heroku-postgresql:hobby-dev
|
116
|
+
|
117
|
+
heroku run rails db:migrate
|
118
|
+
|
119
|
+
heroku container:release web
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
#credential fileを利用しているため環境変数にmaster.keyを設定
|
124
|
+
|
125
|
+
heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
|
126
|
+
|
127
|
+
```
|
3
title変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Heroku Docker Rails5 エラー
|
1
|
+
Heroku Docker Rails5 エラー H13
|
test
CHANGED
File without changes
|
2
docker-compose 追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -45,3 +45,49 @@
|
|
45
45
|
CMD ["rails", "server", "-b", "0.0.0.0"]
|
46
46
|
|
47
47
|
```
|
48
|
+
|
49
|
+
Docker-compose.yml
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
version: '3'
|
54
|
+
|
55
|
+
services:
|
56
|
+
|
57
|
+
db:
|
58
|
+
|
59
|
+
image: postgres:11.2
|
60
|
+
|
61
|
+
ports:
|
62
|
+
|
63
|
+
- '5432:5432'
|
64
|
+
|
65
|
+
volumes:
|
66
|
+
|
67
|
+
- postgresql-data:/var/lib/postgresql/data
|
68
|
+
|
69
|
+
web:
|
70
|
+
|
71
|
+
build: .
|
72
|
+
|
73
|
+
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
74
|
+
|
75
|
+
volumes:
|
76
|
+
|
77
|
+
- .:/myapp
|
78
|
+
|
79
|
+
ports:
|
80
|
+
|
81
|
+
- "3000:3000"
|
82
|
+
|
83
|
+
depends_on:
|
84
|
+
|
85
|
+
- db
|
86
|
+
|
87
|
+
volumes:
|
88
|
+
|
89
|
+
postgresql-data:
|
90
|
+
|
91
|
+
driver: local
|
92
|
+
|
93
|
+
```
|
1
docker file 追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,3 +11,37 @@
|
|
11
11
|
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
|
12
12
|
|
13
13
|
```
|
14
|
+
|
15
|
+
Docker file
|
16
|
+
|
17
|
+
```
|
18
|
+
|
19
|
+
FROM ruby:2.6.3
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
24
|
+
|
25
|
+
&& apt-get install -y nodejs
|
26
|
+
|
27
|
+
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
RUN mkdir /myapp
|
32
|
+
|
33
|
+
WORKDIR /myapp
|
34
|
+
|
35
|
+
ADD Gemfile /myapp/Gemfile
|
36
|
+
|
37
|
+
ADD Gemfile.lock /myapp/Gemfile.lock
|
38
|
+
|
39
|
+
RUN bundle install
|
40
|
+
|
41
|
+
COPY . /myapp
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
CMD ["rails", "server", "-b", "0.0.0.0"]
|
46
|
+
|
47
|
+
```
|