質問編集履歴

2

配置先のディレクトリ構成を追加

2021/02/27 01:46

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -118,7 +118,49 @@
118
118
 
119
119
 
120
120
 
121
+ 配置先のディレクトリ構成
121
122
 
123
+ ```
124
+
125
+ drwxrwxr-x 10 ec2-user ec2-user 4096 Dec 8 08:10 app
126
+
127
+ drwxr-xr-x 2 ec2-user ec2-user 4096 Dec 8 08:10 bin
128
+
129
+ drwxrwxr-x 5 ec2-user ec2-user 4096 Dec 8 08:10 config
130
+
131
+ -rw-rw-r-- 1 ec2-user ec2-user 130 Dec 8 08:10 config.ru
132
+
133
+ drwxrwxr-x 3 ec2-user ec2-user 4096 Jan 25 07:52 db
134
+
135
+ -rw-r--r-- 1 ec2-user ec2-user 340 Feb 23 10:28 docker-compose.yml
136
+
137
+ -rw-r--r-- 1 ec2-user ec2-user 231 Feb 23 10:26 Dockerfile-rails
138
+
139
+ -rw-rw-r-- 1 ec2-user ec2-user 2240 Jan 23 08:57 Gemfile
140
+
141
+ -rw-rw-r-- 1 ec2-user ec2-user 5765 Jan 23 08:58 Gemfile.lock
142
+
143
+ drwxrwxr-x 4 ec2-user ec2-user 4096 Dec 8 08:10 lib
144
+
145
+ drwxrwxr-x 2 ec2-user ec2-user 4096 Jan 2 08:50 log
146
+
147
+ -rw-rw-r-- 1 ec2-user ec2-user 69 Dec 8 08:10 package.json
148
+
149
+ drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 8 08:10 public
150
+
151
+ -rw-rw-r-- 1 ec2-user ec2-user 227 Dec 8 08:10 Rakefile
152
+
153
+ -rw-rw-r-- 1 ec2-user ec2-user 374 Dec 8 08:10 README.md
154
+
155
+ drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 8 08:10 storage
156
+
157
+ drwxrwxr-x 9 ec2-user ec2-user 4096 Dec 8 08:10 test
158
+
159
+ drwxrwxr-x 6 ec2-user ec2-user 4096 Dec 9 05:40 tmp
160
+
161
+ drwxrwxr-x 2 ec2-user ec2-user 4096 Dec 8 08:10 vendor
162
+
163
+ ```
122
164
 
123
165
 
124
166
 

1

ディレクトリ配置のdocker-compose.yml、Dockerfileの内容の追加

2021/02/27 01:46

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -46,6 +46,84 @@
46
46
 
47
47
 
48
48
 
49
+
50
+
51
+
52
+
53
+ docker-compose.yml
54
+
55
+ ```
56
+
57
+ version: '3'
58
+
59
+ services:
60
+
61
+ db:
62
+
63
+ image: mysql:5.7
64
+
65
+ environment:
66
+
67
+ MYSQL_ROOT_PASSWORD: 'password'
68
+
69
+ ports:
70
+
71
+ - "4306:3306"
72
+
73
+
74
+
75
+ web:
76
+
77
+ build: .
78
+
79
+ command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
80
+
81
+ volumes:
82
+
83
+ - .:/app_name
84
+
85
+ ports:
86
+
87
+ - "3000:3000"
88
+
89
+ depends_on:
90
+
91
+ - db
92
+
93
+ ```
94
+
95
+
96
+
97
+ Dockerfile
98
+
99
+ ```
100
+
101
+ FROM ruby:2.4.5
102
+
103
+ RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
104
+
105
+ RUN mkdir /workdir
106
+
107
+ WORKDIR /workdir
108
+
109
+ ADD Gemfile /workdir/Gemfile
110
+
111
+ ADD Gemfile.lock /workdir/Gemfile.lock
112
+
113
+ RUN bundle install
114
+
115
+ ADD . /workdir
116
+
117
+ ```
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
49
127
  ### 試したこと
50
128
 
51
129