job "nats" { type = "service" group "nats" { network { mode = "host" port "nats" { to = 4222 } } task "nats" { driver = "docker" config { image = "nats:alpine" ports = ["nats"] } resources { cpu = 500 memory = 1000 } service { name = "nats" port = "nats" provider = "consul" check { type = "tcp" interval = "5s" timeout = "1s" } } } } }