-
Notifications
You must be signed in to change notification settings - Fork 0
/
job.nomad.hcl
53 lines (46 loc) · 1.12 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
job "dfunkt" {
namespace = "auth"
type = "service"
group "dfunkt" {
network {
port "http" { }
}
service {
name = "dfunkt"
port = "http"
provider = "nomad"
tags = [
"traefik.enable=true",
"traefik.http.routers.dfunkt.rule=Host(`dfunkt.datasektionen.se`)",
"traefik.http.routers.dfunkt.tls.certresolver=default",
]
}
task "dfunkt" {
driver = "docker"
config {
image = var.image_tag
ports = ["http"]
}
template {
data = <<ENV
PORT={{ env "NOMAD_PORT_http" }}
{{ with nomadVar "nomad/jobs/dfunkt" }}
SESSION_SECRET={{ .session_secret }}
DATABASE_URL=postgres://dfunkt:{{ .database_password }}@postgres.dsekt.internal:5432/dfunkt
LOGIN_KEY={{ .login_api_key }}
{{ end }}
NODE_ENV=production
PLS_URL=https://pls.datasektionen.se
LOGIN_API_URL=https://login.datasektionen.se
LOGIN_FRONTEND_URL=https://login.datasektionen.se
ENV
destination = "local/.env"
env = true
}
}
}
}
variable "image_tag" {
type = string
default = "ghcr.io/datasektionen/dfunkt:latest"
}