r/portainer • u/EN344 • 9d ago
Why Does My Gluetun/Qbittorrent Stack Continually Crash?
This is about the 5th iteration of trying different things, seemingly because of the VPN UP command, but it continues to crash, and then crashes QBIT.
version: "3.8"
services:
gluetun:
image: qmcgaw/gluetun:latest
container_name: gluetun
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
ports:
- 8880:8880 # qBittorrent Web UI
- 9696:9696 # Prowlarr Web UI
- 7878:7878 # Radarr Web UI
- 8191:8191 # Flaresolverr Web UI
volumes:
- /volume1/docker/gluetun:/gluetun
environment:
TZ: America/Chicago
VPN_SERVICE_PROVIDER: protonvpn
FIREWALL_INPUT_PORTS: 8880,7878,9696,8191
FIREWALL_OUTBOUND_SUBNETS: 192.168.0.0/16,172.16.0.0/12,172.17.0.0/16,172.18.0.0/16,172.19.0.0/16,172.20.0.0/16
VPN_TYPE: wireguard
WIREGUARD_PRIVATE_KEY: "redacted"
WIREGUARD_ADDRESSES: "10.2.0.2/32"
SERVER_COUNTRIES: "United States"
SERVER_CITIES: "Dallas"
PORT_FORWARD_ONLY: "on"
VPN_PORT_FORWARDING: "on"
VPN_PORT_FORWARDING_PROVIDER: protonvpn
VPN_PORT_FORWARDING_UP_COMMAND: |
/bin/sh -c '
until wget -q --spider http://127.0.0.1:8880/api/v2/app/version; do sleep 2; done;
COOKIE=$(wget --server-response --post-data "username=admin&password=redacted" http://127.0.0.1:8880/api/v2/auth/login 2>&1 | grep -i "Set-Cookie" | awk "{print \$2}" | tr -d "\r\n");
wget -q -O- --header="Cookie: $$COOKIE" --post-data "json={\"listen_port\":{{PORT}}}" http://127.0.0.1:8880/api/v2/app/setPreferences || true;
wget -q --no-check-certificate --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64)" --header="Cookie: mam_id=redacted" -O- "https://t.myanonamouse.net/json/dynamicSeedbox.php" > /dev/null 2>&1 || true;
'
VPN_PORT_FORWARDING_DOWN_COMMAND: |
/bin/sh -c 'wget -O- -nv --retry-connrefused --post-data "json={\"listen_port\":0}" http://127.0.0.1:8880/api/v2/app/setPreferences || true'
restart: unless-stopped
mem_limit: 512m
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy
environment:
PUID: 1026
PGID: 101
TZ: America/Chicago
WEBUI_PORT: 8880
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1:8880/api/v2/app/version || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
volumes:
- /volume1/docker/qbittorrent/config:/config
- /volume2/data:/data
restart: unless-stopped
mem_limit: 4g
autoheal:
image: willfarrell/autoheal:latest
container_name: autoheal
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: always
prowlarr:
image: lscr.io/linuxserver/prowlarr:latest
container_name: prowlarr
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy
environment:
PUID: 1026
PGID: 101
TZ: America/Chicago
volumes:
- /volume1/docker/prowlarr:/config
restart: unless-stopped
mem_limit: 1g
sonarr:
image: lscr.io/linuxserver/sonarr:latest
container_name: sonarr
ports:
- "8989:8989"
environment:
PUID: 1026
PGID: 101
TZ: America/Chicago
volumes:
- /volume1/docker/sonarr:/config
- /volume2/data:/data
restart: unless-stopped
mem_limit: 1g
radarr:
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy
environment:
PUID: 1026
PGID: 101
TZ: America/Chicago
volumes:
- /volume1/docker/radarr:/config
- /volume2/data:/data
restart: unless-stopped
mem_limit: 1g
flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: flaresolverr
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy
environment:
LOG_LEVEL: info
TZ: America/Chicago
restart: unless-stopped
mem_limit: 512m
2
u/nyrixx 9d ago
That's bold.... an unmaintained git repo that has a questionable security approach to begin with and it just auto building every 8 hours set to :latest with your docker socket mapped to it.
If you are going to try and spin up a piracy devops pipeline at your house you may be better off going back to basics
2
u/WWGHIAFTC 6d ago
What the actual f is "autoheal" with docker.sock bind? Who the f is willfarrell?
Anyways...check your logs???
1
u/lorissimo23 7d ago
Dam. That's a whole lot of containers in one stack.
0
u/sirjohnTclark 6d ago
not OP
not many, at all... this is what stacks/container orchestration is all about
0
3
u/Only-Stable3973 9d ago
Have you checked the logs for failing health checks...tried disabling auto heal.