I have a Ubuntu server and I have Mariadb installed locally as I plan to run multiple instances which will need its own separate db and running 30 or so different database containers seem kinda useless.
However, when I do so, My containers can't find 'localhost' as the database hostname. I also tried entering my local IP (192.168.0.xxx) with no luck Do things change when I try to input db details to docker container? What do I need to do to make it work?
update: I created my docker container by pasting the docker compose templates then editing the necessary details like ports, volumes etc. I do this through portainer.
I haven't done anything to connect the container host with the server host as I don't know how to and probably the main reason this isn't working.
update 2: tried method mentioned by Hans Kilian
Here's a temporary Wordpress dockercompose file I created
and this is my Wordpress database details:
It still refuses connection