This repository was archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnginx-4-secret-generic.nomad
More file actions
74 lines (64 loc) · 1.42 KB
/
nginx-4-secret-generic.nomad
File metadata and controls
74 lines (64 loc) · 1.42 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
job "nginx" {
datacenters = ["dc1"]
type = "service"
group "nginx" {
count = 1
vault {
policies = ["frontend"]
}
task "nginx" {
driver = "docker"
config {
image = "nginx"
port_map {
http = 80
}
volumes = [
"custom/default.conf:/etc/nginx/conf.d/default.conf"
]
}
template {
data = <<EOH
server {
location / {
root /local/data/;
}
}
EOH
destination = "custom/default.conf"
}
# consul kv put features/motd 'Good afternoon.'
# vault write secret/motd ttl=10s message='Live demos rock!!!'
template {
data = <<EOH
{{ if keyExists "features/motd" }}
{{ key "features/motd" }}
{{ else }}
Good morning.
{{ end }}
{{ with secret "secret/motd" }}
{{ .Data.message }}{{ end }}
EOH
destination = "local/data/index.html"
}
resources {
cpu = 100 # 100 MHz
memory = 128 # 128 MB
network {
mbits = 10
port "http" {}
}
}
service {
name = "nginx"
tags = ["frontend","urlprefix-/nginx strip=/nginx"]
port = "http"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
}
}
}