job "caddy" { datacenters = [ "gribse-house", "zuma-house", "mayel-house" ] type = "system" priority = 90 group "caddy" { network { port "http_port" { static = 80 } port "https_port" { static = 443 } } task "server" { driver = "docker" config { image = "caddy" network_mode = "host" ports = [ "http_port", "https_port" ] volumes = [ "secrets/Caddyfile:/etc/caddy/Caddyfile" ] } resources { cpu = 1000 memory = 400 } template { data = file("./Caddyfile") destination = "secrets/Caddyfile" perms = 400 } service { name = "caddy-http" port = "http_port" address_mode = "host" } service { name = "caddy-https" port = "https_port" address_mode = "host" } } } }