-
Notifications
You must be signed in to change notification settings - Fork 11
/
job.nomad.hcl
75 lines (64 loc) · 1.43 KB
/
job.nomad.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
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
job "meta-tv" {
type = "service"
group "meta-tv" {
network {
port "http" { }
port "mongodb" {
static = 27017
}
}
service {
name = "meta-tv"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.meta-tv.rule=Host(`meta-tv.datasektionen.se`)",
"traefik.http.routers.meta-tv.tls.certresolver=default",
]
}
task "meta-tv" {
driver = "docker"
config {
image = var.image_tag
ports = ["http"]
}
template {
data = <<ENV
{{ with nomadVar "nomad/jobs/meta-tv" }}
LOGIN_KEY={{ .login_api_key }}
MONGO_URL=mongodb://tv:{{ .database_password }}@{{ env "NOMAD_ADDR_mongodb" }}/
BANLIST={{ .banlist }}
{{ end }}
PORT={{ env "NOMAD_PORT_http" }}
ROOT_URL=https://tv.datasektionen.se
ENV
destination = "local/.env"
env = true
}
resources {
memory = 200
}
}
task "mongodb" {
driver = "docker"
config {
image = "docker.io/mongo:3.2.9"
}
template {
data = <<ENV
{{ with nomadVar "nomad/jobs/meta-tv" }}
MONGO_INITDB_ROOT_USERNAME=tv
MONGO_INITDB_ROOT_PASSWORD={{ .database_password }}
{{ end }}
ENV
destination = "local/.env"
env = true
}
}
}
}
variable "image_tag" {
type = string
default = "ghcr.io/datasektionen/meta-tv:latest"
}