-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhttp.hcl
45 lines (40 loc) · 857 Bytes
/
http.hcl
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
job "http" {
group "group" {
network {
mode = "host"
port "http" { static = 8181 }
}
task "task" {
driver = "pledge"
user = "nobody"
config {
command = "python3"
args = ["-m", "http.server", "${NOMAD_PORT_http}", "--directory", "${NOMAD_TASK_DIR}"]
promises = "stdio rpath inet"
unveil = ["r:/etc/mime.types", "r:${NOMAD_TASK_DIR}"]
importance = "low"
}
resources {
memory = 128
memory_max = 200
}
template {
destination = "local/index.html"
data = <<EOH
<!doctype html>
<html>
<title>example</title>
<body><p>Hello, friend!</p></body>
</html>
EOH
}
}
restart {
attempts = 0
mode = "fail"
}
update {
min_healthy_time = "2s"
}
}
}