How to route traffic from one container to another in docker compose How to route traffic from one container to another in docker compose docker docker

How to route traffic from one container to another in docker compose


I found it by myself. I can add myapp to the same network of openvpn by adding a config to myapp service.

network_mode: "service:openvpn"

By this, I cannot expose the port on myapp but I can expose ports in openvpn to access myapp as they are in the same network