-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob.nomad.hcl
54 lines (47 loc) · 1.18 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
job "darkmode" {
type = "service"
group "darkmode" {
network {
port "http" { }
}
service {
name = "darkmode"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.darkmode.rule=Host(`darkmode.datasektionen.se`)",
"traefik.http.routers.darkmode.tls.certresolver=default",
]
}
task "darkmode" {
driver = "docker"
config {
image = var.image_tag
ports = ["http"]
}
template {
data = <<ENV
{{ with nomadVar "nomad/jobs/darkmode" }}
LOGIN_API_KEY={{ .login_api_key }}
DATABASE_URL=postgresql://darkmode:{{ .database_password }}@postgres.dsekt.internal:5432/darkmode
{{ end }}
PORT={{ env "NOMAD_PORT_http" }}
LOGIN_API_URL=http://sso.nomad.dsekt.internal/legacyapi
LOGIN_FRONTEND_URL=https://sso.datasektionen.se/legacyapi
PLS_URL=https://pls.datasektionen.se
WEBHOOKS=http://taitan.nomad.dsekt.internal/
ENV
destination = "local/.env"
env = true
}
resources {
memory = 15
}
}
}
}
variable "image_tag" {
type = string
default = "ghcr.io/datasektionen/darkmode:latest"
}