実現したいこと
Dockerのコンテナが走っている状況までできたので、localhostでWordPressの初期設定の画面を表示させたいです。
前提
Vagrant, VirtualBox, docker-composeをつかっています。
関係するのではないかという箇所を記載させていただきます。
Vagrantfile
1Vagrant.configure("2") do |config| 2 # The most common configuration options are documented and commented below. 3 # For a complete reference, please see the online documentation at 4 # https://docs.vagrantup.com. 5 6 # Every Vagrant development environment requires a box. You can search for 7 # boxes at https://vagrantcloud.com/search. 8 config.vm.box = "ubuntu/xenial64" 9 10 # Disable automatic box update checking. If you disable this, then 11 # boxes will only be checked for updates when the user runs 12 # `vagrant box outdated`. This is not recommended. 13 # config.vm.box_check_update = false 14 15 # Create a forwarded port mapping which allows access to a specific port 16 # within the machine from a port on the host machine. In the example below, 17 # accessing "localhost:8080" will access port 80 on the guest machine. 18 # NOTE: This will enable public access to the opened port 19 # config.vm.network "forwarded_port", guest: 80, host: 8080 20 21 # Create a forwarded port mapping which allows access to a specific port 22 # within the machine from a port on the host machine and only allow access 23 # via 127.0.0.1 to disable public access 24 config.vm.network "forwarded_port", guest: 8000, host: 8080, host_ip: "127.0.0.1" 25 26 # Create a private network, which allows host-only access to the machine 27 # using a specific IP. 28 config.vm.network "private_network", ip: "192.168.33.10" 29 30 # Create a public network, which generally matched to bridged network. 31(略) 32 # config.vm.network "public_network" 33 34 # Share an additional folder to the guest VM. The first argument is 35 # the path on the host to the actual folder. The second argument is 36 # the path on the guest to mount the folder. And the optional third 37 # argument is a set of non-required options. 38 config.vm.synced_folder "./workspace", "/vagrant" 39 40 # Provider-specific configuration so you can fine-tune various 41 # backing providers for Vagrant. These expose provider-specific options. 42 # Example for VirtualBox: 43 # 44 config.vm.provider "virtualbox" do |vb| 45 # # Display the VirtualBox GUI when booting the machine 46 # vb.gui = true 47 # 48 # # Customize the amount of memory on the VM: 49 vb.memory = "2048" 50 end
こちらはdocker-compose.ymlです。
yml
1version: '3'2services:3 db:4 user: '1000:50'5 image: mysql:5.76 #container_name: "mysql57"7 volumes:8 - ./db/mysql:/var/lib/mysql 9 restart: always 10 environment:11 MYSQL_ROOT_PASSWORD: root_pass_fB3uWvTS 12 MYSQL_DATABASE: wordpress_db 13 MYSQL_USER: user 14 MYSQL_PASSWORD: user_pass_Ck6uTvrQ 15 16 wordpress:17 image: wordpress:latest 18 #container_name: "wordpress"19 volumes:20 - ./wordpress/html:/var/www/html 21 - ./php/php.ini:/usr/local/etc/php/conf.d/php.ini 22 restart: always 23 depends_on:24 - db 25 ports:26 - 8080:8027 environment:28 WORDPRESS_DB_HOST: db:330629 WORDPRESS_DB_NAME: wordpress_db 30 WORDPRESS_DB_USER: user 31 WORDPRESS_DB_PASSWORD: user_pass_Ck6uTvrQ 32 33 phpmyadmin:34 image: phpmyadmin/phpmyadmin:latest 35 #container_name: "phpmyadmin"36 restart: always 37 depends_on:38 - db 39 ports:40 - 8888:80
この2つが関係するのではないかと思って、色々やってみるもののうまくいきません。
docker system prune --all docker volumn prune
などコンテナーを一旦削除するなりしてみるのですが、うまく行っていません。
またコンテナの状況について、わかりやすくはないかもしれませんが、念のためこちらに記載致します。
| Image | STATUS | PORTS |
|---|---|---|
| phpmyadmin/phpmyadmin:latest | Up About an Hour | 0.0.0.0:8888->80/tcp |
| wordpress:latest | Up About an Hour | 0.0.0.0:8080->80/tcp |
| mysql:5.7 | Up About an Hour | 3306/tcp, 33060/tcp |
config.vm.network "forwarded_port", guest: 8000, host: 8080, host_ip: "127.0.0.1"
と記載があったため、
localhost: 8080でも localhost:8000でもうまくいきません。
すごく単純なことが原因かもしれないのですが、調べながらやってみてもうまく行かず質問させていただきました。
もしよろしければご教示頂きたく思います。
また加えて恐縮ですが、まちがいの理由について教えていただけると尚ありがたいです

0 コメント