Hello,
I am running 2 docker container one is apache (webserver) and other is MySQl (dataserver).
I created a network, network details are given below.
"Name": "dataserver",
"EndpointID": "d3f070376cb77a2b0d61b21b2b8ba6f72e60f127d3e09a14f07acab199316110",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"dd66c6cfb221d715141be2df2bb7dd0a94224d741b811670867a2112fd576c58": {
"Name": "webserver",
"EndpointID": "de664313d5e6b4bdfc2692f8c700da09f8ba34582d4f51004cf48d1568de2032",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
Here, I am using host 172.18.0.3 to connect to DB from the webserver. But when I restart the container the IP allocate to them is interchanged, due to this I cannot connect to the DB server from webserver.
Do I need to change each time my web server configuration to connect to DB or any other method is available?