Hi
The variable you need to change is the WORDPRESS_DB_HOST one, as you state, the current configuration is that there would be a container named “db” in the same network that it can use.
If you have an external, like, not the same server as docker is running on, you can simply change WORDPRESS_DB_HOST to an IP or host of the database server.
If the database is hosted on the same server, you have a couple of options:
- Set WORDPRESS_DB_HOST to the IP of the server
- Get the gateway IP of your docker network, and use that (the gateway ip will be the host)
- set “network_mode” to “host”, in short, this means that the container will run as if it was a normal service on your server, meaning that you then can set WORDPRESS_DB_HOST to 127.0.0.1