Please check my docker-compose file:
Now Two container are running :
<a href=" " rel="noreferrer"><img src=" " alt="enter image description here"></a>
IP address for the two containers are properly configured. But when i connect to the <a href="http://172.16.238.12:8000/" rel="noreferrer">http://172.16.238.12:8000/</a> (172.16.238.12 - Is the IP Address of the wordpress). It says, "Unable to connect".
When i check logs files of the docker_wordpress_1, it is showing me :
I didnot understand what went wrong.
Code:
version: '2'
services:
db:
image: mysql:latest
networks:
app_net:
ipv4_address: 172.16.238.10
ipv6_address: 2001:3984:3989::10
volumes:
- "./data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
image: wordpress
links:
- db
ports:
- "8000:80"
environment:
- WORDPRESS_DB_PASSWORD=wordpress
networks:
app_net:
ipv4_address: 172.16.238.12
ipv6_address: 2001:3984:3989::10
volumes:
- ./code:/code
- ./html:/var/www/html
networks:
app_net:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "true"
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1
- subnet: 2001:3984:3989::/64
gateway: 2001:3984:3989::1
Now Two container are running :
<a href=" " rel="noreferrer"><img src=" " alt="enter image description here"></a>
IP address for the two containers are properly configured. But when i connect to the <a href="http://172.16.238.12:8000/" rel="noreferrer">http://172.16.238.12:8000/</a> (172.16.238.12 - Is the IP Address of the wordpress). It says, "Unable to connect".
When i check logs files of the docker_wordpress_1, it is showing me :
Code:
Warning: mysqli::mysqli(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in - on line 10
MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
I didnot understand what went wrong.