Files
infra/2-nomad-config/webapp.nomad.hcl

43 lines
667 B
HCL

job "demo-webapp" {
group "demo" {
count = 3
network {
port "http" {
to = -1
}
}
service {
name = "demo-webapp"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.demo-webapp.middlewares=auth@file",
]
check {
type = "http"
path = "/"
interval = "2s"
timeout = "2s"
}
}
task "server" {
env {
PORT = NOMAD_PORT_http
NODE_IP = NOMAD_IP_http
}
driver = "docker"
config {
image = "hashicorp/demo-webapp-lb-guide"
ports = ["http"]
}
}
}
}