fix(qbittorrent): Monitor internet connectivity and restart container on failure

This commit is contained in:
Adrien Poupa 2023-11-10 11:37:38 -05:00
parent 850db72f92
commit 274ef53421

View File

@ -239,7 +239,9 @@ services:
- ${DOWNLOAD_ROOT}:/data/torrents - ${DOWNLOAD_ROOT}:/data/torrents
restart: always restart: always
healthcheck: healthcheck:
test: [ "CMD", "curl", "--fail", "http://127.0.0.1:8080" ] # Container may fail if the PIA's token expired, so mark as unhealthy when there is no internet connection
# see: https://github.com/qdm12/gluetun/issues/641#issuecomment-933856220
test: [ "CMD", "curl", "--fail", "http://127.0.0.1:8080", "https://google.com" ]
interval: 5s interval: 5s
retries: 10 retries: 10
network_mode: "service:vpn" network_mode: "service:vpn"
@ -287,7 +289,6 @@ services:
- PORT_FORWARDING=1 - PORT_FORWARDING=1
- PORT_PERSIST=1 - PORT_PERSIST=1
- PORT_SCRIPT=/pia-shared/portupdate-qbittorrent.sh - PORT_SCRIPT=/pia-shared/portupdate-qbittorrent.sh
- EXIT_ON_FATAL=1
sysctls: sysctls:
- net.ipv4.conf.all.src_valid_mark=1 - net.ipv4.conf.all.src_valid_mark=1
- net.ipv6.conf.default.disable_ipv6=1 - net.ipv6.conf.default.disable_ipv6=1