質問編集履歴

3

修正

2020/08/12 04:40

投稿

keisuke.F
keisuke.F

スコア19

test CHANGED
File without changes
test CHANGED
@@ -125,3 +125,181 @@
125
125
  gem_data:
126
126
 
127
127
  ```
128
+
129
+
130
+
131
+ database.yml
132
+
133
+ ```
134
+
135
+ default: &default
136
+
137
+ adapter: mysql2
138
+
139
+ encoding: utf8
140
+
141
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
142
+
143
+ username: root
144
+
145
+ password: password
146
+
147
+ host: db
148
+
149
+
150
+
151
+ development:
152
+
153
+ <<: *default
154
+
155
+ database: myapp_development
156
+
157
+
158
+
159
+ # Warning: The database defined as "test" will be erased and
160
+
161
+ # re-generated from your development database when you run "rake".
162
+
163
+ # Do not set this db to the same as development or production.
164
+
165
+ test:
166
+
167
+ <<: *default
168
+
169
+ database: myapp_test
170
+
171
+ ```
172
+
173
+
174
+
175
+ gemfile
176
+
177
+ ```
178
+
179
+ source 'https://rubygems.org'
180
+
181
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
182
+
183
+
184
+
185
+ ruby '2.5.8'
186
+
187
+
188
+
189
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
190
+
191
+ gem 'rails', '~> 5.2.4', '>= 5.2.4.3'
192
+
193
+ # Use mysql as the database for Active Record
194
+
195
+ gem 'mysql2', '>= 0.4.4', '< 0.6.0'
196
+
197
+ # Use Puma as the app server
198
+
199
+ gem 'puma', '~> 3.11'
200
+
201
+ # Use SCSS for stylesheets
202
+
203
+ gem 'sass-rails', '~> 5.0'
204
+
205
+ # Use Uglifier as compressor for JavaScript assets
206
+
207
+ gem 'uglifier', '>= 1.3.0'
208
+
209
+ # See https://github.com/rails/execjs#readme for more supported runtimes
210
+
211
+ # gem 'mini_racer', platforms: :ruby
212
+
213
+
214
+
215
+ # Use CoffeeScript for .coffee assets and views
216
+
217
+ gem 'coffee-rails', '~> 4.2'
218
+
219
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
220
+
221
+ gem 'turbolinks', '~> 5'
222
+
223
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
224
+
225
+ gem 'jbuilder', '~> 2.5'
226
+
227
+ # Use Redis adapter to run Action Cable in production
228
+
229
+ # gem 'redis', '~> 4.0'
230
+
231
+ # Use ActiveModel has_secure_password
232
+
233
+ # gem 'bcrypt', '~> 3.1.7'
234
+
235
+
236
+
237
+ # Use ActiveStorage variant
238
+
239
+ # gem 'mini_magick', '~> 4.8'
240
+
241
+
242
+
243
+ # Use Capistrano for deployment
244
+
245
+ # gem 'capistrano-rails', group: :development
246
+
247
+
248
+
249
+ # Reduces boot times through caching; required in config/boot.rb
250
+
251
+ gem 'bootsnap', '>= 1.1.0', require: false
252
+
253
+
254
+
255
+ group :development, :test do
256
+
257
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
258
+
259
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
260
+
261
+ end
262
+
263
+
264
+
265
+ group :development do
266
+
267
+ # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
268
+
269
+ gem 'web-console', '>= 3.3.0'
270
+
271
+ gem 'listen', '>= 3.0.5', '< 3.2'
272
+
273
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
274
+
275
+ gem 'spring'
276
+
277
+ gem 'spring-watcher-listen', '~> 2.0.0'
278
+
279
+ end
280
+
281
+
282
+
283
+ group :test do
284
+
285
+ # Adds support for Capybara system testing and selenium driver
286
+
287
+ gem 'capybara', '>= 2.15'
288
+
289
+ gem 'selenium-webdriver'
290
+
291
+ # Easy installation and use of chromedriver to run system tests with Chrome
292
+
293
+ gem 'chromedriver-helper'
294
+
295
+ end
296
+
297
+
298
+
299
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
300
+
301
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
302
+
303
+
304
+
305
+ ```

2

syuusei

2020/08/12 04:40

投稿

keisuke.F
keisuke.F

スコア19

test CHANGED
File without changes
test CHANGED
@@ -34,10 +34,94 @@
34
34
 
35
35
 
36
36
 
37
- Gemfile
37
+ Dockerfile
38
38
 
39
39
  ```
40
40
 
41
+ FROM ruby:2.5
42
+
43
+ RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
44
+
45
+
46
+
47
+ RUN mkdir /myapp
48
+
49
+ WORKDIR /myapp
50
+
51
+
52
+
41
- https://gyazo.com/6e16940eba855a989b72efd95bbe8685
53
+ COPY Gemfile /myapp/Gemfile
54
+
55
+ COPY Gemfile.lock /myapp/Gemfile.lock
56
+
57
+
58
+
59
+ RUN bundle install
60
+
61
+ COPY . /myapp
42
62
 
43
63
  ```
64
+
65
+
66
+
67
+ docker-compose.yml
68
+
69
+ ```
70
+
71
+ version: '3'
72
+
73
+
74
+
75
+ services:
76
+
77
+ db:
78
+
79
+ image: mysql:5.6
80
+
81
+ environment:
82
+
83
+ MYSQL_USER: root
84
+
85
+ MYSQL_ROOT_PASSWORD: password
86
+
87
+ ports:
88
+
89
+ - "3306:3306"
90
+
91
+ volumes:
92
+
93
+ - ./db/mysql/volumes:/var/lib/mysql
94
+
95
+
96
+
97
+ web:
98
+
99
+ build: .
100
+
101
+ command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
102
+
103
+ volumes:
104
+
105
+ - .:/myapp
106
+
107
+ - gem_data:/usr/local/bundle
108
+
109
+ ports:
110
+
111
+ - 3000:3000
112
+
113
+ depends_on:
114
+
115
+ - db
116
+
117
+ tty: true
118
+
119
+ stdin_open: true
120
+
121
+
122
+
123
+ volumes:
124
+
125
+ gem_data:
126
+
127
+ ```

1

修正

2020/08/12 04:39

投稿

keisuke.F
keisuke.F

スコア19

test CHANGED
File without changes
test CHANGED
@@ -31,3 +31,13 @@
31
31
  ruby 2.5.8
32
32
 
33
33
  rails 5.2.4
34
+
35
+
36
+
37
+ Gemfile
38
+
39
+ ```
40
+
41
+ https://gyazo.com/6e16940eba855a989b72efd95bbe8685
42
+
43
+ ```