Comment on Separate Docker stacks using gluetun networking
Dust0741@lemmy.world 13 hours agonetwork_mode
is only for multiple containers in the same stack.
Comment on Separate Docker stacks using gluetun networking
Dust0741@lemmy.world 13 hours agonetwork_mode
is only for multiple containers in the same stack.
CumBroth@discuss.tchncs.de 9 hours ago
Uhh, I think you might be confused. Let me explain a bit more:
Services
andContainers
aren’t the same thing. The distinction usually doesn’t matter in typical self-hosting scenarios, but in this case it does.In short:
Services
are what you define in acompose
file;Containers
are what you spin up based on those service definitions.network_mode
is a service attribute and it can be defined for each service separately.network_mode: “service:{name}”
requires the service being referenced to be part of the same stack. This is probably what you were thinking of when you wrote this reply.network_mode: “container:{name}” can freely reference any preexisting container. This helps you achieve what you want. You can define your
gluetuncontainer independently, along with any services you might want to be part of the same stack, and give it a unique identifier using
container_name: myIndependentGluetun. After spinning it up, run your
Qbittorrentcontainer or whatever service you want to route through the
gluetuncontainer after adding
network_mode: “container:myIndependentGluetun”.Dust0741@lemmy.world 9 hours ago
Oooooooooooo I totally was confused. Thank you for this!!!