-
Notifications
You must be signed in to change notification settings - Fork 0
/
job.nomad.hcl
105 lines (89 loc) · 2.51 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
job "taitan" {
type = "service"
group "bawang" {
network {
port "http" { }
}
service {
name = "taitan-bawang"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.taitan-bawang.rule=Host(`taitan.datasektionen.se`)",
"traefik.http.routers.taitan-bawang.tls.certresolver=default",
"traefik.enable=true",
"traefik.http.routers.taitan-bawang-internal.rule=Host(`taitan.nomad.dsekt.internal`)",
"traefik.http.routers.taitan-bawang-internal.entrypoints=web-internal",
]
}
task "taitan" {
driver = "docker"
config {
image = var.bawang_image_tag
ports = ["http"]
}
template {
data = <<ENV
PORT={{ env "NOMAD_PORT_http" }}
DARKMODE_URL=https://darkmode.datasektionen.se/
CONTENT_URL=https://github.com/datasektionen/bawang-content.git
TOKEN={{ with nomadVar "nomad/jobs/taitan" }}{{ .bawang_content_token }}{{ end }}
DEFAULT_LANG=sv
ENV
destination = "local/.env"
env = true
}
resources {
memory = 30
}
}
}
group "styrdokument" {
network {
port "http" { }
}
service {
name = "taitan-styrdokument"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.taitan-styrdokument.rule=Host(`taitan-styrdokument.datasektionen.se`)",
"traefik.http.routers.taitan-styrdokument.tls.certresolver=default",
"traefik.enable=true",
"traefik.http.routers.taitan-styrdokument-internal.rule=Host(`taitan-styrdokument.nomad.dsekt.internal`)",
"traefik.http.routers.taitan-styrdokument-internal.entrypoints=web-internal",
]
}
task "taitan" {
driver = "docker"
config {
image = var.styrdokument_image_tag
ports = ["http"]
}
template {
data = <<ENV
PORT={{ env "NOMAD_PORT_http" }}
DARKMODE_URL=https://darkmode.datasektionen.se/
CONTENT_URL=https://github.com/datasektionen/styrdokument.git
TOKEN={{ with nomadVar "nomad/jobs/taitan" }}{{ .styrdokument_token }}{{ end }}
DEFAULT_LANG=sv
ENV
destination = "local/.env"
env = true
}
resources {
memory = 30
}
}
}
}
variable "bawang_image_tag" {
type = string
default = "ghcr.io/datasektionen/taitan:latest"
}
variable "styrdokument_image_tag" {
type = string
default = "ghcr.io/datasektionen/taitan:latest"
}