I have several dependencies in my arr stack. Gluetun depends on privateer and qbittorrent depends on gluetun being healthy
Here’s part of my compose file. I hope this helps.
############################
GLUETUN
############################
gluetun:
image: qmcgaw/gluetun:latest
container_name: gluetun
hostname: gluetun
depends_on:
privateerr:
condition: service_healthy
restart: unless-stopped
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
entrypoint:
- /bin/sh
- /privateerr/gluetun-entrypoint-wrapper.sh
volumes:
- /srv/docker/gluetun:/gluetun:rw
- /srv/docker/gluetun:/tmp/gluetun:rw
- /srv/docker/gluetun/scripts:/privateerr:ro
environment:
- VPN_SERVICE_PROVIDER=custom
- VPN_TYPE=wireguard
# credentials removed
- PRIVATEERR_METADATA_PATH=/gluetun/wireguard/privateerr.env
- PRIVATEERR_GLUETUN_METADATA_WAIT_SECONDS=120
- GLUETUN_DEFAULT_ENTRYPOINT=/gluetun-entrypoint
- HEALTH_SERVER_ADDRESS=127.0.0.1:9999
- HEALTH_RESTART_VPN=on
# Only ports for containers that actually share gluetun's network
# namespace are published here: flaresolverr + both qbittorrents.
# (The arrs moved to the arrnet network and publish their own ports.)
ports:
- 8080:8080 #qbittorrent
- 8081:8081 #qbittorrent_other
- 8191:8191 #flaresolverr
- 6881:6881 #qbittorrent
- 6881:6881/udp #qbittorrent
- 6882:6882 #qbittorrent_other
- 6882:6882/udp #qbittorrent_other
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:9999/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
############################
QBITTORRENT
############################
STAYS ON THE VPN – this is the whole point of the gluetun network.
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
network_mode: “service:gluetun”
depends_on:
# Wait for the gluetun container to be ‘healthy’ (VPN connected)
gluetun:
condition: service_healthy___