質問編集履歴

1

追記修正

2020/07/14 01:03

投稿

darumausagi
darumausagi

スコア18

test CHANGED
@@ -1 +1 @@
1
- dockerでwordpressのコンテナがリバースプロキシに失敗し、表示できない
1
+ shuudockerでwordpressのコンテナがリバースプロキシに失敗し、表示できない
test CHANGED
@@ -424,6 +424,190 @@
424
424
 
425
425
 
426
426
 
427
+ **追記**
428
+
429
+ [wordpress用のxml]
430
+
431
+ 設定を変えていくつか試してみたので、そのうちのひとつを記載いたします…
432
+
433
+
434
+
435
+ ```ここに言語を入力
436
+
437
+ version: '3'
438
+
439
+ services:
440
+
441
+
442
+
443
+ mariadb:
444
+
445
+ image: mariadb:latest
446
+
447
+ container_name: mariadb
448
+
449
+ volumes:
450
+
451
+ - /etc/vps/portal/mysql:/var/lib/mysql
452
+
453
+ environment:
454
+
455
+ - MYSQL_ROOT_HOST=${MYSQL_ROOT_HOST}
456
+
457
+ - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
458
+
459
+ - MYSQL_USER=${MYSQL_USER}
460
+
461
+ - MYSQL_PASSWORD=${MYSQL_PASSWORD}
462
+
463
+ - MYSQL_DATABASE=${MYSQL_DATABASE}
464
+
465
+ env_file: .env
466
+
467
+ networks:
468
+
469
+ - common_link
470
+
471
+
472
+
473
+ wordpress01:
474
+
475
+ image: wordpress:php7.4-fpm
476
+
477
+ container_name: wordpress01
478
+
479
+ environment:
480
+
481
+ - WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST}
482
+
483
+ - WORDPRESS_DB_USER=${WORDPRESS_DB_USER}
484
+
485
+ - WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD}
486
+
487
+ - WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME}
488
+
489
+ env_file: .env
490
+
491
+ depends_on:
492
+
493
+ - mariadb
494
+
495
+ volumes:
496
+
497
+ - /etc/vps/portal/portal/public:/var/www/html
498
+
499
+ restart: always
500
+
501
+ networks:
502
+
503
+ - common_link
504
+
505
+
506
+
507
+
508
+
509
+ test01:
510
+
511
+ restart: always
512
+
513
+ image: nginx
514
+
515
+ build:
516
+
517
+ context: .
518
+
519
+ dockerfile: Dockerfile
520
+
521
+ container_name: test01
522
+
523
+ environment:
524
+
525
+ - VIRTUAL_HOST=test01.hoge.com
526
+
527
+ volumes:
528
+
529
+ - /etc/vps/portal/test01/conf/default.conf:/etc/nginx/nginx.conf
530
+
531
+ - /etc/vps/portal/public:/var/www/html
532
+
533
+ depends_on:
534
+
535
+ - wordpress01
536
+
537
+ networks:
538
+
539
+ - common_link
540
+
541
+
542
+
543
+
544
+
545
+ networks:
546
+
547
+ common_link:
548
+
549
+ external:
550
+
551
+ name: common_link
552
+
553
+ ```
554
+
555
+
556
+
557
+ [.env]
558
+
559
+ ```ここに言語を入力
560
+
561
+ # mariadb
562
+
563
+ MYSQL_ROOT_HOST=db
564
+
565
+ MYSQL_ROOT_PASSWORD=password
566
+
567
+ MYSQL_USER=root
568
+
569
+ MYSQL_PASSWORD=password
570
+
571
+ MYSQL_DATABASE=wordpress
572
+
573
+
574
+
575
+ # wordpress
576
+
577
+ WORDPRESS_DB_HOST=db
578
+
579
+ WORDPRESS_DB_USER=root
580
+
581
+ WORDPRESS_DB_PASSWORD=password
582
+
583
+ WORDPRESS_DB_NAME=wordpress
584
+
585
+ ```
586
+
587
+
588
+
589
+
590
+
591
+ [Dockerfile]
592
+
593
+ ```ここに言語を入力
594
+
595
+ FROM nginx:latest
596
+
597
+
598
+
599
+ COPY nginx/default.conf /etc/nginx/conf.d/wordpress.conf
600
+
601
+
602
+
603
+ CMD ["nginx", "-g", "daemon off;"]
604
+
605
+ ```
606
+
607
+
608
+
609
+
610
+
427
611
 
428
612
 
429
613
 
@@ -462,4 +646,12 @@
462
646
 
463
647
 
464
648
 
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
465
657
  お手数ですが、よろしくお願いいたします。