質問編集履歴
2
ファイル名プレビューで映るように
test
CHANGED
File without changes
|
test
CHANGED
@@ -288,9 +288,11 @@
|
|
288
288
|
|
289
289
|
|
290
290
|
|
291
|
-
|
292
|
-
|
293
|
-
|
291
|
+
docker-compose.yml
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
```
|
294
296
|
|
295
297
|
version: '3'
|
296
298
|
|
@@ -430,6 +432,12 @@
|
|
430
432
|
|
431
433
|
|
432
434
|
|
435
|
+
|
436
|
+
|
437
|
+
webpacker.yml
|
438
|
+
|
439
|
+
|
440
|
+
|
433
441
|
```webpacker.yml
|
434
442
|
|
435
443
|
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
1
補足情報を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -213,3 +213,417 @@
|
|
213
213
|
webpacker 4.3.0
|
214
214
|
|
215
215
|
Docker version 20.10.2
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
```Dockerfile
|
220
|
+
|
221
|
+
FROM ruby:2.7
|
222
|
+
|
223
|
+
RUN apt-get update -qq && \
|
224
|
+
|
225
|
+
apt-get install -y apt-utils \
|
226
|
+
|
227
|
+
build-essential \
|
228
|
+
|
229
|
+
libpq-dev \
|
230
|
+
|
231
|
+
nodejs \
|
232
|
+
|
233
|
+
default-mysql-client \
|
234
|
+
|
235
|
+
yarn
|
236
|
+
|
237
|
+
RUN mkdir /myapp
|
238
|
+
|
239
|
+
WORKDIR /myapp
|
240
|
+
|
241
|
+
COPY Gemfile /myapp/Gemfile
|
242
|
+
|
243
|
+
COPY Gemfile.lock /myapp/Gemfile.lock
|
244
|
+
|
245
|
+
RUN bundle install
|
246
|
+
|
247
|
+
COPY . /myapp
|
248
|
+
|
249
|
+
USER postgres
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
# Add a script to be executed every time the container starts.
|
256
|
+
|
257
|
+
COPY entrypoint.sh /usr/bin/
|
258
|
+
|
259
|
+
RUN chmod +x /usr/bin/entrypoint.sh
|
260
|
+
|
261
|
+
ENTRYPOINT ["entrypoint.sh"]
|
262
|
+
|
263
|
+
EXPOSE 3000
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
# Start the main process.
|
268
|
+
|
269
|
+
CMD ["rails", "server", "-b", "0.0.0.0"]
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
# Railsに必要なパッケージをインストール
|
274
|
+
|
275
|
+
RUN apt-get update -qq && apt-get install -y nodejs
|
276
|
+
|
277
|
+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
278
|
+
|
279
|
+
&& apt-get install -y nodejs
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
EXPOSE 8080
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
```
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
```docker-compose.yml
|
294
|
+
|
295
|
+
version: '3'
|
296
|
+
|
297
|
+
services:
|
298
|
+
|
299
|
+
db:
|
300
|
+
|
301
|
+
image: postgres
|
302
|
+
|
303
|
+
volumes:
|
304
|
+
|
305
|
+
- ./tmp/db:/var/lib/postgresql/data
|
306
|
+
|
307
|
+
environment:
|
308
|
+
|
309
|
+
POSTGRES_PASSWORD: 'postgres'
|
310
|
+
|
311
|
+
web:
|
312
|
+
|
313
|
+
build: .
|
314
|
+
|
315
|
+
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
316
|
+
|
317
|
+
volumes:
|
318
|
+
|
319
|
+
- .:/myapp
|
320
|
+
|
321
|
+
ports:
|
322
|
+
|
323
|
+
- "3000:3000"
|
324
|
+
|
325
|
+
depends_on:
|
326
|
+
|
327
|
+
- db
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
postgres:
|
332
|
+
|
333
|
+
image: postgres:13
|
334
|
+
|
335
|
+
user: postgres
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
```
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
```Gemfile
|
344
|
+
|
345
|
+
source 'https://rubygems.org'
|
346
|
+
|
347
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
gem 'rails', '~> 6.0.3.4'
|
354
|
+
|
355
|
+
gem 'puma', '~> 3.11'
|
356
|
+
|
357
|
+
gem 'sassc-rails', '2.1.2'
|
358
|
+
|
359
|
+
gem 'uglifier', '>= 1.3.0'
|
360
|
+
|
361
|
+
gem 'coffee-rails', '~> 4.2'
|
362
|
+
|
363
|
+
gem 'turbolinks', '~> 5'
|
364
|
+
|
365
|
+
gem 'jbuilder', '~> 2.5'
|
366
|
+
|
367
|
+
gem 'bootsnap', '>= 1.1.0', require: false
|
368
|
+
|
369
|
+
gem 'bootstrap', '~> 4.5.0'
|
370
|
+
|
371
|
+
gem 'jquery-rails'
|
372
|
+
|
373
|
+
gem 'webpacker', '~> 4.0'
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
group :development, :test do
|
380
|
+
|
381
|
+
gem 'rspec-rails'
|
382
|
+
|
383
|
+
gem 'sqlite3'
|
384
|
+
|
385
|
+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
386
|
+
|
387
|
+
end
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
group :development do
|
392
|
+
|
393
|
+
gem 'web-console', '>= 3.3.0'
|
394
|
+
|
395
|
+
gem 'listen', '>= 3.0.5', '< 3.2'
|
396
|
+
|
397
|
+
gem 'spring'
|
398
|
+
|
399
|
+
gem 'spring-watcher-listen', '~> 2.0.0'
|
400
|
+
|
401
|
+
end
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
group :test do
|
406
|
+
|
407
|
+
gem 'capybara', '>= 2.15'
|
408
|
+
|
409
|
+
gem 'selenium-webdriver'
|
410
|
+
|
411
|
+
gem 'chromedriver-helper'
|
412
|
+
|
413
|
+
end
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
group :production do
|
418
|
+
|
419
|
+
gem 'pg'
|
420
|
+
|
421
|
+
end
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
```
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
```webpacker.yml
|
434
|
+
|
435
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
default: &default
|
440
|
+
|
441
|
+
source_path: app/javascript
|
442
|
+
|
443
|
+
source_entry_path: packs
|
444
|
+
|
445
|
+
public_root_path: public
|
446
|
+
|
447
|
+
public_output_path: packs
|
448
|
+
|
449
|
+
cache_path: tmp/cache/webpacker
|
450
|
+
|
451
|
+
check_yarn_integrity: false
|
452
|
+
|
453
|
+
webpack_compile_output: true
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
# Additional paths webpack should lookup modules
|
458
|
+
|
459
|
+
# ['app/assets', 'engine/foo/app/assets']
|
460
|
+
|
461
|
+
resolved_paths: []
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
466
|
+
|
467
|
+
cache_manifest: false
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
# Extract and emit a css file
|
472
|
+
|
473
|
+
extract_css: false
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
static_assets_extensions:
|
478
|
+
|
479
|
+
- .jpg
|
480
|
+
|
481
|
+
- .jpeg
|
482
|
+
|
483
|
+
- .png
|
484
|
+
|
485
|
+
- .gif
|
486
|
+
|
487
|
+
- .tiff
|
488
|
+
|
489
|
+
- .ico
|
490
|
+
|
491
|
+
- .svg
|
492
|
+
|
493
|
+
- .eot
|
494
|
+
|
495
|
+
- .otf
|
496
|
+
|
497
|
+
- .ttf
|
498
|
+
|
499
|
+
- .woff
|
500
|
+
|
501
|
+
- .woff2
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
extensions:
|
506
|
+
|
507
|
+
- .mjs
|
508
|
+
|
509
|
+
- .js
|
510
|
+
|
511
|
+
- .sass
|
512
|
+
|
513
|
+
- .scss
|
514
|
+
|
515
|
+
- .css
|
516
|
+
|
517
|
+
- .module.sass
|
518
|
+
|
519
|
+
- .module.scss
|
520
|
+
|
521
|
+
- .module.css
|
522
|
+
|
523
|
+
- .png
|
524
|
+
|
525
|
+
- .svg
|
526
|
+
|
527
|
+
- .gif
|
528
|
+
|
529
|
+
- .jpeg
|
530
|
+
|
531
|
+
- .jpg
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
development:
|
536
|
+
|
537
|
+
<<: *default
|
538
|
+
|
539
|
+
compile: true
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
|
544
|
+
|
545
|
+
check_yarn_integrity: true
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
550
|
+
|
551
|
+
dev_server:
|
552
|
+
|
553
|
+
https: false
|
554
|
+
|
555
|
+
host: localhost
|
556
|
+
|
557
|
+
port: 3035
|
558
|
+
|
559
|
+
public: localhost:3035
|
560
|
+
|
561
|
+
hmr: false
|
562
|
+
|
563
|
+
# Inline should be set to true if using HMR
|
564
|
+
|
565
|
+
inline: true
|
566
|
+
|
567
|
+
overlay: true
|
568
|
+
|
569
|
+
compress: true
|
570
|
+
|
571
|
+
disable_host_check: true
|
572
|
+
|
573
|
+
use_local_ip: false
|
574
|
+
|
575
|
+
quiet: false
|
576
|
+
|
577
|
+
pretty: false
|
578
|
+
|
579
|
+
headers:
|
580
|
+
|
581
|
+
'Access-Control-Allow-Origin': '*'
|
582
|
+
|
583
|
+
watch_options:
|
584
|
+
|
585
|
+
ignored: '**/node_modules/**'
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
test:
|
592
|
+
|
593
|
+
<<: *default
|
594
|
+
|
595
|
+
compile: true
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
# Compile test packs to a separate directory
|
600
|
+
|
601
|
+
public_output_path: packs-test
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
production:
|
606
|
+
|
607
|
+
<<: *default
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
612
|
+
|
613
|
+
compile: false
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
# Extract and emit a css file
|
618
|
+
|
619
|
+
extract_css: true
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
# Cache manifest.json for performance
|
624
|
+
|
625
|
+
cache_manifest: true
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
```
|