direct communication needs you open ports on each VPS, forward these ports to containers, allow containers to access outside network ( network type, so not just containers’ localhost resources), and set MongoDB to also listen to the IP of your VPSs.
you will need to set it to listen to localhost (127.0.0.1), local docker network (10.xx.xx.xx, 172.xx.xx.xx ), vps network (192.168.xx.xx).
you can listen to all IPs in a network with a single entry but I don’t know (for now) what to use. it might be to end address with 0 or 1, 10.5.0.0 or 10.5.0.1 or maybe it is like 10.5.0.1/8. I haven’t tried this many variations and it is a chance to try it out on your side if you don’t already know the answer 