job "qbittorrent" { # region = "global" datacenters = ["dc1"] type = "service" constraint { attribute = "${attr.kernel.name}" value = "linux" } constraint { attribute = "${attr.cpu.arch}" operator = "regexp" value = "amd64" } update { # Stagger updates every 60 seconds stagger = "90s" max_parallel = 1 healthy_deadline = "2m" health_check = "task_states" } group "qbittorrent" { count = 1 restart { attempts = 8 interval = "20m" delay = "10s" mode = "delay" } task "qbittorrent-vpn" { driver = "docker" lifecycle { hook = "prestart" sidecar = true } config { // image = "registry.service.dc1.consul:5000/openpyn:latest" // image = "qmcgaw/gluetun" image = "qmcgaw/gluetun" memory_hard_limit = "1024" ports = [ "shadowsocks", "http_proxy", "http_admin", "qbittorrent_51413", "qbittorrent_80", "socks" ] cap_add = [ "NET_ADMIN", "NET_BIND_SERVICE", ] #network_mode = "host" #network_mode = "vpn" volumes = [ "/etc/localtime:/etc/localtime", "/mnt/syncthing/mullvad:/vpn", "local/gluetun.toml:/gluetun/config.toml" ] devices = [ { host_path = "/dev/net/tun" container_path = "/dev/net/tun" }, ] } template { data = <