If the containers are on the same custom bridge network (not the default bridge) then you should be able to use the container name as the database host. Custom bridge networks have an internal DNS mapping for each container so containers can reference each other by name.
【Docker Port Question】Why can't we connect nextcloud to external databases?
in Docker Engine
Posted
That was it for me, thank you!