# export to json for ci/cd scripts with the following command # nomad job run -output blog.nomad.hcl > blog.nomad.json locals { HOST = "cbraaten.dev" } variable "image_tag" { type = string default = "latest" } job "blog" { type = "service" group "blog" { count = 1 network { port "http" { to = 3000 } } service { name = "blog" provider = "consul" port = "http" tags = [ "traefik.enable=true", "traefik.http.routers.domainredirect.tls=true", "traefik.http.routers.domainredirect.entrypoints=websecure", "traefik.http.routers.domainredirect.rule=Host(`${local.HOST}`)", ] } task "blog" { driver = "docker" config { image = "git.cbraaten.dev/caleb/blog:${var.image_tag}" ports = ["http"] } } update { max_parallel = 1 min_healthy_time = "10s" healthy_deadline = "3m" auto_revert = true } } }