job "traefik" { datacenters = ["alo"] group "lbs" { network { port "http" { static = "80" } port "https" { static = "443" } port "admin" { #host_network = "tailscale" static = "9002" } port "promtail_healthcheck" {} } task "traefik" { driver = "docker" service { name = "traefik" port = "https" tags = [ "traefik.enable=true", "traefik.http.routers.api.entryPoints=websecure", "traefik.http.routers.api.rule=Host(`traefik.v.paler.net`)", "traefik.http.routers.api.service=api@internal", ] check { type = "http" port = "admin" path = "/ping" interval = "10s" timeout = "2s" } } service { name = "traefik-admin" port = "admin" tags = [ "metrics" ] } config { image = "traefik:latest" ports = ["http", "https", "admin"] network_mode = "host" volumes = [ "local/traefik.yml:/etc/traefik/traefik.yml", "/data/compute/config/traefik:/config", ] } template { data = <[\w\.]+) - (?P[^ ]*) \[(?P[^\]]+)\] "(?P[^ ]*) (?P[^ ]*) (?P[^ ]*)" (?P[\d]+) (?P[\d]+) "(?P[^"]*)" "(?P[^"]*)"? (?P\d+) "(?P.+)" "(?P.+)" (?P\d+)ms' - labels: method: status: frontend_name: EOH destination = "local/config.yaml" } resources { cpu = 50 memory = 256 } # poststart, and sidecar=true, so Promtail will start *after* Traefik ( since it has nothing to do before Traefik isup and running), # and run for as long as it does lifecycle { hook = "poststart" sidecar = true } # a service for a health check to determine the state of Promtail service { check { type = "http" port = "promtail_healthcheck" path = "/ready" interval = "10s" timeout = "2s" } } } } }