I’ve currently run a few containers through a vpn container.
One thing I noticed is that if I compose the containers with
network_mode: service: vpn
I cannot reach the web ui via their respective ports from inside the container but using
network_mode: container: vpn
I can reach them.
If I curl from inside the container to check the IP both run through the vpn container.
It also isn’t providing more safety as it seems as I use one compose file for the vpn and all the containers that should network through is and use the
- depends on: vpn
variable so it creates the vpn container first and then the others. It also seems that there is no connectivity at all if the vpn container isn’t running, so the “killswitch” also works.
So what’s the point of using network_mode: service instead of network_mode: container or what are the exact differences?