homelab/nomad-job/vikunja.nomad

94 lines
2.7 KiB
Plaintext
Raw Normal View History

2022-11-21 21:28:41 +00:00
job "vikunja" {
datacenters = ["homelab"]
2022-12-10 16:10:32 +00:00
priority = 70
2022-11-21 21:28:41 +00:00
type = "service"
meta {
forcedeploy = "0"
}
group "vikunja"{
network {
mode = "host"
port "front" {
to = 80
}
port "api" {
to = 3456
}
}
vault{
policies= ["vikunja"]
}
task "api" {
driver = "docker"
service {
name = "vikunja-api"
port = "api"
tags = [
"traefik.enable=true",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`) && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`)",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.certresolver=myresolver",
2023-10-07 17:09:56 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.entrypoints=web,websecure",
2022-11-21 21:28:41 +00:00
]
}
config {
image = "vikunja/api"
ports = ["api"]
}
env {
2023-11-01 07:42:04 +00:00
VIKUNJA_DATABASE_HOST = "active.db.service.consul"
2022-11-21 21:28:41 +00:00
VIKUNJA_DATABASE_TYPE = "postgres"
VIKUNJA_DATABASE_USER = "vikunja"
VIKUNJA_DATABASE_DATABASE = "vikunja"
VIKUNJA_SERVICE_JWTSECRET = uuidv4()
VIKUNJA_SERVICE_FRONTENDURL = "https://${NOMAD_JOB_NAME}.ducamps.win/"
}
template {
data= <<EOH
{{ with secret "secrets/data/database/vikunja"}}
VIKUNJA_DATABASE_PASSWORD= "{{ .Data.data.password }}"
{{end}}
EOH
destination = "secrets/sample.env"
env = true
}
resources {
2022-12-04 09:32:37 +00:00
memory = 100
2022-11-21 21:28:41 +00:00
}
}
task "front" {
driver = "docker"
service {
name = "vikunja-front"
port = "front"
tags = [
"traefik.enable=true",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`)",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.certresolver=myresolver",
2023-10-07 16:40:40 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.entrypoints=web,websecure",
2022-11-21 21:28:41 +00:00
"homer.enable=true",
"homer.name=vikunka",
"homer.service=Application",
"homer.logo=https://${NOMAD_JOB_NAME}.ducamps.win/images/icons/apple-touch-icon-180x180.png",
"homer.target=_blank",
"homer.url=https://${NOMAD_JOB_NAME}.ducamps.win",
]
}
config {
image = "vikunja/frontend"
ports = ["front"]
}
resources {
memory = 20
}
}
}
}