質問編集履歴
7
エラーコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -543,3 +543,23 @@
|
|
543
543
|
|
544
544
|
|
545
545
|
```
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
# 追記
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
```ここに言語を入力
|
554
|
+
|
555
|
+
~@yk golfour_aws % docker-compose run web rails db:migrate
|
556
|
+
|
557
|
+
Starting golfour_aws_db_1 ... done
|
558
|
+
|
559
|
+
Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"exec\": executable file not found in $PATH": unknown
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
```
|
6
タイトルを編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -386,6 +386,10 @@
|
|
386
386
|
|
387
387
|
|
388
388
|
|
389
|
+
docker-composed.yml:
|
390
|
+
|
391
|
+
|
392
|
+
|
389
393
|
``` docker-composed.yml
|
390
394
|
|
391
395
|
version: '3'
|
@@ -454,6 +458,12 @@
|
|
454
458
|
|
455
459
|
|
456
460
|
|
461
|
+
|
462
|
+
|
463
|
+
database.yml:
|
464
|
+
|
465
|
+
|
466
|
+
|
457
467
|
``` database.yml
|
458
468
|
|
459
469
|
default: &default
|
5
タイトルを編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -386,7 +386,7 @@
|
|
386
386
|
|
387
387
|
|
388
388
|
|
389
|
-
```docker-composed.yml
|
389
|
+
``` docker-composed.yml
|
390
390
|
|
391
391
|
version: '3'
|
392
392
|
|
@@ -454,7 +454,7 @@
|
|
454
454
|
|
455
455
|
|
456
456
|
|
457
|
-
```database.yml
|
457
|
+
``` database.yml
|
458
458
|
|
459
459
|
default: &default
|
460
460
|
|
4
エラーコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -513,3 +513,23 @@
|
|
513
513
|
|
514
514
|
|
515
515
|
```
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
```ここに言語を入力
|
520
|
+
|
521
|
+
~@yk golfour_aws % docker-compose run web bundle exec rake db:create
|
522
|
+
|
523
|
+
Starting golfour_aws_db_1 ... done
|
524
|
+
|
525
|
+
Can't connect to MySQL server on 'db' (111 "Connection refused")
|
526
|
+
|
527
|
+
Couldn't create 'golfour_development' database. Please check your configuration.
|
528
|
+
|
529
|
+
rake aborted!
|
530
|
+
|
531
|
+
Mysql2::Error::ConnectionError: Can't connect to MySQL server on 'db' (111 "Connection refused")
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
```
|
3
mysqlエラーを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -377,3 +377,139 @@
|
|
377
377
|
Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
378
378
|
|
379
379
|
```
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
# 追記
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
```docker-composed.yml
|
390
|
+
|
391
|
+
version: '3'
|
392
|
+
|
393
|
+
services:
|
394
|
+
|
395
|
+
db:
|
396
|
+
|
397
|
+
image: mysql:8.0
|
398
|
+
|
399
|
+
command: --default-authentication-plugin=mysql_native_password
|
400
|
+
|
401
|
+
environment:
|
402
|
+
|
403
|
+
MYSQL_ROOT_PASSWORD: password
|
404
|
+
|
405
|
+
MYSQL_DATABASE: golfour_development
|
406
|
+
|
407
|
+
MYSQL_USER: yuki
|
408
|
+
|
409
|
+
MYSQL_PASSWORD: password
|
410
|
+
|
411
|
+
TZ: Asia/Tokyo
|
412
|
+
|
413
|
+
volumes:
|
414
|
+
|
415
|
+
- ./mysql/mysql_data:/var/lib/mysql
|
416
|
+
|
417
|
+
- ./logs:/var/log/mysql
|
418
|
+
|
419
|
+
- ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
|
420
|
+
|
421
|
+
ports:
|
422
|
+
|
423
|
+
- "4306:3306"
|
424
|
+
|
425
|
+
web:
|
426
|
+
|
427
|
+
build:
|
428
|
+
|
429
|
+
context: .
|
430
|
+
|
431
|
+
dockerfile: Dockerfile
|
432
|
+
|
433
|
+
command: /bin/sh -c "rm -f /workdir/tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
434
|
+
|
435
|
+
tty: true
|
436
|
+
|
437
|
+
stdin_open: true
|
438
|
+
|
439
|
+
depends_on:
|
440
|
+
|
441
|
+
- db
|
442
|
+
|
443
|
+
ports:
|
444
|
+
|
445
|
+
- "3000:3000"
|
446
|
+
|
447
|
+
volumes:
|
448
|
+
|
449
|
+
- .:/workdir
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
```
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
```database.yml
|
458
|
+
|
459
|
+
default: &default
|
460
|
+
|
461
|
+
adapter: mysql2
|
462
|
+
|
463
|
+
encoding: utf8
|
464
|
+
|
465
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
development:
|
470
|
+
|
471
|
+
<<: *default
|
472
|
+
|
473
|
+
database: golfour_development
|
474
|
+
|
475
|
+
username: yuki
|
476
|
+
|
477
|
+
password: password
|
478
|
+
|
479
|
+
host: db
|
480
|
+
|
481
|
+
socket: /tmp/mysql.sock
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
test:
|
486
|
+
|
487
|
+
<<: *default
|
488
|
+
|
489
|
+
database: golfour_test
|
490
|
+
|
491
|
+
host: db
|
492
|
+
|
493
|
+
username: yuki
|
494
|
+
|
495
|
+
password: password
|
496
|
+
|
497
|
+
socket: /tmp/mysql.sock
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
production:
|
502
|
+
|
503
|
+
<<: *default
|
504
|
+
|
505
|
+
database: <%= ENV['DB_NAME'] %>
|
506
|
+
|
507
|
+
username: <%= ENV['DB_USERNAME'] %>
|
508
|
+
|
509
|
+
password: <%= ENV['DB_PASSWORD'] %>
|
510
|
+
|
511
|
+
host: <%= ENV['DB_HOSTNAME'] %>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
```
|
2
mysqlエラーを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -353,3 +353,27 @@
|
|
353
353
|
|
354
354
|
|
355
355
|
```
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
# 追記
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
```ここに言語を入力
|
364
|
+
|
365
|
+
~@yk golfour_aws % docker-compose run web bundle exec rake db:create
|
366
|
+
|
367
|
+
Starting golfour_aws_db_1 ... done
|
368
|
+
|
369
|
+
Database 'golfour_development' already exists
|
370
|
+
|
371
|
+
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
372
|
+
|
373
|
+
Couldn't create 'golfour_test' database. Please check your configuration.
|
374
|
+
|
375
|
+
rake aborted!
|
376
|
+
|
377
|
+
Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
378
|
+
|
379
|
+
```
|
1
ログを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -309,3 +309,47 @@
|
|
309
309
|
|
310
310
|
|
311
311
|
```
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
# 追記
|
316
|
+
|
317
|
+
```ここに言語を入力
|
318
|
+
|
319
|
+
~@yk golfour_aws % docker-compose ps
|
320
|
+
|
321
|
+
Name Command State Ports
|
322
|
+
|
323
|
+
------------------------------------------------------------------------------------
|
324
|
+
|
325
|
+
golfour_aws_db_1 docker-entrypoint.sh mysqld Exit 1
|
326
|
+
|
327
|
+
golfour_aws_web_1 /bin/sh -c rm -f /workdir/ ... Up 0.0.0.0:3000->3000/tcp
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
~@yk golfour_aws % docker-compose logs db
|
332
|
+
|
333
|
+
Attaching to golfour_aws_db_1
|
334
|
+
|
335
|
+
db_1 | 2020-08-16 12:54:40+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
336
|
+
|
337
|
+
db_1 | 2020-08-16 12:54:41+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
338
|
+
|
339
|
+
db_1 | 2020-08-16 12:54:41+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
340
|
+
|
341
|
+
db_1 | 2020-08-16 12:55:16+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
342
|
+
|
343
|
+
db_1 | 2020-08-16 12:55:17+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
344
|
+
|
345
|
+
db_1 | 2020-08-16 12:55:17+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
346
|
+
|
347
|
+
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
348
|
+
|
349
|
+
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
350
|
+
|
351
|
+
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
```
|