-
Notifications
You must be signed in to change notification settings - Fork 0
/
webapp.nomad
51 lines (42 loc) · 863 Bytes
/
webapp.nomad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
job "demo-webapp" {
datacenters = ["[[ .datacenter ]]"]
constraint {
operator = "!="
attribute = "${node.unique.name}"
value = "metal1"
}
group "demo" {
count = 2
network {
port "http" {
to = -1
}
}
service {
name = "demo-webapp"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.myapp.rule=Host(`myapp.[[ .lantld ]]`)",
"traefik.http.routers.myapp.entrypoints=web",
]
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"]
}
}
}
}