Hi all,
I’ve been going through a guide by techhut for setting up gluetun, and there’s a small bit of code that he adds in from his github, and I want to understand the implications of using it.
He writes:
When containers are in the same docker compose all you need to add is a network_mode: service:container_name and open the ports through the gluetun container. See example from the compose.yaml below.
And here’s the code: services: gluetun: # This config is for wireguard only tested with AirVPN image: qmcgaw/gluetun container_name: gluetun … ports: - 8888:8112 # deluge web interface - 58846:58846 # deluge RPC deluge: image: linuxserver/deluge:latest container_name: deluge … network_mode: service:gluetun
If you could please explain to me what this means, and if there are any risks associated with this, I would really appreciate it.
It’s fine, it just grabs the network settings from the gluetun service.
Btw, your post is hard to read due to formatting. Surround the code block with triple backticks at the top and bottom like this:
```
code goes here
```
Example:
services: gluetun: # This config is for wireguard only tested with AirVPN image: qmcgaw/gluetun container_name: gluetun ... ports: - 8888:8112 # deluge web interface - 58846:58846 # deluge RPC deluge: image: linuxserver/deluge:latest container_name: deluge ... network_mode: service:gluetun
Thank you so much for your reply. Follow up question, does this open up any ports to the greater internet in any way? That is really where my concern is, as I have heard that is dangerous to do
Any ports used in docker will be open on your computer and accessible to any device in your network.
However, to open up a port to the internet, you’d have to do port-forwarding on your router. If you haven’t done that, any incoming connections will just be dropped at the router-level.