job "traefik-cloudflare-v3" { datacenters = ["dc1"] type = "service" group "traefik" { count = 1 constraint { attribute = "${node.unique.name}" value = "hcp1" } volume "traefik-certs" { type = "host" read_only = false source = "traefik-certs" } volume "traefik-dynamic" { type = "host" read_only = true source = "/root/mgmt/infrastructure/traefik/dynamic" } network { mode = "host" port "http" { static = 80 } port "https" { static = 443 } port "traefik" { static = 8080 } } task "traefik" { driver = "exec" config { command = "/usr/local/bin/traefik" args = [ "--configfile=/local/traefik.yml" ] } env { CLOUDFLARE_EMAIL = "locksmithknight@gmail.com" CLOUDFLARE_DNS_API_TOKEN = "0aPWoLaQ59l0nyL1jIVzZaEx2e41Gjgcfhn3ztJr" CLOUDFLARE_ZONE_API_TOKEN = "0aPWoLaQ59l0nyL1jIVzZaEx2e41Gjgcfhn3ztJr" } volume_mount { volume = "traefik-certs" destination = "/opt/traefik/certs" read_only = false } volume_mount { volume = "traefik-dynamic" destination = "/opt/traefik/dynamic" read_only = true } template { data = <