homelab/nomad-job/apps/vikunja.nomad

90 lines
2.5 KiB
Plaintext
Raw Normal View History

2022-11-21 21:28:41 +00:00
job "vikunja" {
datacenters = ["homelab"]
2024-05-20 10:14:40 +00:00
priority = 70
type = "service"
2022-11-21 21:28:41 +00:00
meta {
forcedeploy = "0"
}
2024-05-20 10:14:40 +00:00
group "vikunja" {
2022-11-21 21:28:41 +00:00
network {
mode = "host"
port "front" {
to = 80
}
port "api" {
to = 3456
}
}
2024-05-20 10:14:40 +00:00
vault {
policies = ["vikunja"]
2022-11-21 21:28:41 +00:00
}
task "api" {
driver = "docker"
service {
name = "vikunja-api"
port = "api"
tags = [
2024-05-20 10:14:40 +00:00
"traefik.enable=true",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.eu`)",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.eu",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.certresolver=myresolver",
"traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.entrypoints=web,websecure",
"homer.enable=true",
"homer.name=vikunka",
"homer.service=Application",
"homer.logo=https://${NOMAD_JOB_NAME}.ducamps.eu/images/icons/apple-touch-icon-180x180.png",
"homer.target=_blank",
"homer.url=https://${NOMAD_JOB_NAME}.ducamps.eu",
2022-11-21 21:28:41 +00:00
]
}
config {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/vikunja/vikunja"
2024-05-20 10:14:40 +00:00
ports = ["api", "front"]
volumes = ["local/config.yml:/etc/vikunja/config.yml"]
2022-11-21 21:28:41 +00:00
}
env {
2024-05-20 10:14:40 +00:00
VIKUNJA_DATABASE_HOST = "active.db.service.consul"
VIKUNJA_DATABASE_TYPE = "postgres"
VIKUNJA_DATABASE_USER = "vikunja"
VIKUNJA_DATABASE_DATABASE = "vikunja"
VIKUNJA_SERVICE_JWTSECRET = uuidv4()
2023-11-05 18:08:17 +00:00
VIKUNJA_SERVICE_FRONTENDURL = "https://${NOMAD_JOB_NAME}.ducamps.eu/"
2024-05-20 10:14:40 +00:00
VIKUNJA_AUTH_LOCAL = False
2022-11-21 21:28:41 +00:00
}
template {
2024-05-20 10:14:40 +00:00
data = <<EOH
2022-11-21 21:28:41 +00:00
{{ with secret "secrets/data/database/vikunja"}}
VIKUNJA_DATABASE_PASSWORD= "{{ .Data.data.password }}"
{{end}}
EOH
destination = "secrets/sample.env"
2024-05-20 10:14:40 +00:00
env = true
}
template {
data = <<EOH
auth:
openid:
enabled: true
redirecturl: https://vikunja.ducamps.eu/auth/openid/
providers:
- name: Authelia
authurl: https://auth.ducamps.eu
clientid: vikunja
clientsecret: {{ with secret "secrets/data/authelia/vikunja"}} {{ .Data.data.password }} {{end}}
scope: openid profile email
EOH
destination = "local/config.yml"
2022-11-21 21:28:41 +00:00
}
resources {
2022-12-04 09:32:37 +00:00
memory = 100
2022-11-21 21:28:41 +00:00
}
}
2024-05-20 10:14:40 +00:00
2022-11-21 21:28:41 +00:00
}
}