job "grafana" { datacenters = ["dc1"] group "grafana" { count = 1 network { mode = "bridge" port "web" { host_network = "loopback" to = 3000 } } service { port = "web" connect { sidecar_service { proxy { local_service_port = 3000 upstreams { destination_name = "prometheus" local_bind_port = 9090 } } } sidecar_task { resources { cpu = 50 memory = 50 } } } check { type = "http" path = "/" port = "web" interval = "10s" timeout = "10s" } tags = [ "traefik.enable=true", "traefik.http.routers.grafana.entrypoints=web,websecure", "traefik.http.routers.grafana.rule=Host(`grafana.dev.homelab`)", "traefik.subdomain=grafana-sub", "traefik.http.routers.grafana.tls=true", ] } task "grafana" { driver = "docker" config { image = "grafana/grafana:7.3.6" ports = ["web"] mount { type = "bind" target = "/etc/grafana/grafana.ini" source = "local/config/grafana.ini" } mount { type = "bind" target = "/etc/grafana/provisioning" source = "local/config/provisioning" } } env = { "GF_SECURITY_ADMIN_PASSWORD" = "password", "GF_INSTALL_PLUGINS" = "grafana-clock-panel,grafana-piechart-panel,grafana-polystat-panel", } template { data = <