-
Notifications
You must be signed in to change notification settings - Fork 3
/
ffspostgres.nomad
79 lines (66 loc) · 1.38 KB
/
ffspostgres.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
job "ffspostgres" {
datacenters = ["dc1"]
type = "service"
group "ffspostgres" {
restart {
attempts = 10
interval = "5m"
delay = "10s"
mode = "delay"
}
network {
port "db" {
static = 5432
}
}
task "ffspostgres" {
driver = "docker"
config {
image = "postgres:14"
image_pull_timeout = "25m"
ports = ["db"]
}
env {
POSTGRES_DB = "ffs"
POSTGRES_PASSWORD = "ffs"
POSTGRES_USER = "ffs"
OTEL_SERVICE_NAME = "ffspostgres"
}
template {
data = <<EOF
{{ range service "otelcol-grpc" }}
OTEL_EXPORTER_OTLP_ENDPOINT = "http://{{ .Address }}:{{ .Port }}"
{{ end }}
EOF
destination = "local/env"
env = true
}
restart {
attempts = 10
delay = "15s"
interval = "2m"
mode = "delay"
}
resources {
cpu = 55
memory = 300
}
service {
name = "ffspostgres-service"
port = "db"
check {
interval = "10s"
timeout = "5s"
type = "script"
command = "pg_isready"
args = [
"-d", "ffs",
"-h", "${NOMAD_IP_db}",
"-p", "${NOMAD_PORT_db}",
"-U", "ffs"
]
}
}
}
}
}