job "grafana" { datacenters = ["aperture"] type = "service" group "monitoring" { network { port "http" { to = 3000 } port "db" { to = 5432 } } service { name = "grafana" port = "http" check { type = "http" path = "/" interval = "10s" timeout = "2s" } tags = [ "traefik.enable=true", "traefik.http.routers.grafana.entrypoints=web,websecure", "traefik.http.routers.grafana.rule=Host(`grafana.redbrick.dcu.ie`)", "traefik.http.routers.grafana.tls=true", "traefik.http.routers.grafana.tls.certresolver=lets-encrypt", ] } task "grafana" { driver = "docker" user = "1001:1001" env { GF_AUTH_BASIC_ENABLED = "true" GF_INSTALL_PLUGINS = "grafana-piechart-panel" GF_SERVER_ROOT_URL = "https://grafana.redbrick.dcu.ie" } config { image = "grafana/grafana" ports = ["http"] volumes = [ "/storage/nomad/${NOMAD_JOB_NAME}/${NOMAD_TASK_NAME}:/var/lib/grafana", "local/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml" ] } template { data = <