Connect a container to Gluetun
June 30, 2023 ยท View on GitHub
There are various ways to connect a container to Gluetun.
๐ก If you are connecting containers to Gluetun's network stack, you might want to also check the Port mapping page to know how to access ports of containers connected to Gluetun.
Container in the same docker-compose.yml
Add network_mode: "service:gluetun" to your second container so that it uses the gluetun network stack.
There is no need for depends_on.
External container to Gluetun
Add --network=container:gluetun when launching the container, provided Gluetun is already running.
Container in another docker-compose.yml
Add network_mode: "container:gluetun" to your docker-compose.yml, provided Gluetun is already running.