46 lines
765 B
HCL
46 lines
765 B
HCL
job "demo-webapp" {
|
|
datacenters = ["dc1"]
|
|
|
|
group "demo" {
|
|
count = 3
|
|
|
|
network {
|
|
port "http"{
|
|
to = -1
|
|
}
|
|
}
|
|
|
|
service {
|
|
name = "demo-webapp"
|
|
port = "http"
|
|
|
|
tags = [
|
|
"traefik.enable=true",
|
|
"#traefik.http.routers.http.rule=Path(`/myapp`)",
|
|
"traefik.http.routers.http.rule=Host(`test.lan`)",
|
|
]
|
|
|
|
check {
|
|
type = "http"
|
|
path = "/"
|
|
interval = "2s"
|
|
timeout = "2s"
|
|
}
|
|
}
|
|
|
|
task "server" {
|
|
env {
|
|
PORT = "${NOMAD_PORT_http}"
|
|
NODE_IP = "${NOMAD_IP_http}"
|
|
}
|
|
|
|
driver = "podman"
|
|
|
|
config {
|
|
image = "docker.io/hashicorp/demo-webapp-lb-guide"
|
|
ports = ["http"]
|
|
}
|
|
}
|
|
}
|
|
}
|