

Yeah, depends_on only works inside a single compose file/project, so it can’t see gluetun from stack 2 — that’s why you’re getting the undefined error. There’s no built-in cross-stack depends_on, unfortunately.
The cleanest fix IMO is to merge them into one compose file if you can, then depends_on with service_healthy works for everything. If you really want to keep them seperate, a couple of options:
- Start stack 1 first, then have a small wait script before stack 2, something like looping on docker inspect until gluetun’s health status is healthy, then docker compose -f stack2.yml up -d. A bit clunky, but it works and it’s explicit.
- Or use a systemd unit or a wrapper script that runs the two up commands in order, with the wait in between.
- What I wouldn’t do is just add a fixed sleep — gluetun can take a while to bring the tunnel up, and a sleep that works today will bite you on a slow day.
One caveat too: service_healthy only means the container is healthy, not neccessarily that the VPN tunnel itself is fully up, so it’s still worth checking the torrent client actually has the VPN IP before you trust it. FYI, you can test that from inside the client container with curl to an IP checker.
2.5Gb won’t be your bottleneck on the WAN side — 3-4TB a month is only about 10Mbps averge, and even torrent bursts won’t saturate that unless your internet is over a gig. The place I’d watch is traffic hairpinning through the router, like cameras and media going via OPNsense instead of staying on the switch — keep the NVR/Frigate traffic local where you can.
If you do virtualise it, the security bit that matters most is isolation: keep the WAN side separate from your media containers, and keep the Proxmox managment interface on the LAN only, not reachable from WAN. FYI, that’s also how a misconfigured bridge ends up exposing the host.
And keep your old Archer handy as a fallback router with the OPNsense config backed up — if Proxmox needs a reboot, you can swap one cable and be back online. YMMV, but for a house with 50 devices, I’d rather have that fallback than squeeze everything onto one box.