T; R; Trying to get a WordPress dock container container to talk to another docker storage container.
On my Mac, I have a WordPress and MySQL container that I created and configured with the associated MySQL server. In production, I plan to use an instance of Google Cloud MySQL storage, so I plan to remove the MySQL container from the docker layout file (unchecking it), and then split the shared container that I can use from several docker containers.
The problem I am facing is that I cannot connect a WordPress container to a separate MySQL container. Can anyone shed some light on how I can do this?
I tried unsuccessfully to create a network, and also tried to create a fixed IP address that the local field refers to through the / etc / hosts file (my preferred configuration, since I can update the file according to ENV)
WG:
version: '2' services: wordpress: container_name: spmfrontend hostname: spmfrontend domainname: spmfrontend.local image: wordpress:latest restart: always ports: - 8080:80
MySQL:
version: '2' services: mysql: container_name: ic-mysql hostname: ic-mysql domainname: ic-mysql.local restart: always image: mysql:5.7 ports: - 9306:3306
source share