vikunja: init job
This commit is contained in:
parent
c2eacbd13f
commit
c86a618ee1
@ -23,6 +23,8 @@ postgresql_users:
|
||||
password: "{{ lookup('hashi_vault', 'secret=secrets/data/database/paperless:password')}}"
|
||||
- name: dump
|
||||
password: "{{ lookup('hashi_vault', 'secret=secrets/data/database/dump:password')}}"
|
||||
- name: vikunja
|
||||
password: "{{ lookup('hashi_vault', 'secret=secrets/data/database/vikunja:password')}}"
|
||||
|
||||
postgresql_databases:
|
||||
- name: wikijs
|
||||
@ -43,4 +45,6 @@ postgresql_databases:
|
||||
owner: dendrite
|
||||
- name: paperless
|
||||
owner: paperless
|
||||
- name: vikunja
|
||||
owner: vikunja
|
||||
|
||||
|
91
nomad-job/vikunja.nomad
Normal file
91
nomad-job/vikunja.nomad
Normal file
@ -0,0 +1,91 @@
|
||||
|
||||
job "vikunja" {
|
||||
datacenters = ["homelab"]
|
||||
priority = 50
|
||||
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",
|
||||
]
|
||||
}
|
||||
config {
|
||||
image = "vikunja/api"
|
||||
ports = ["api"]
|
||||
}
|
||||
env {
|
||||
VIKUNJA_DATABASE_HOST = "db1.ducamps.win"
|
||||
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 {
|
||||
memory = 30
|
||||
}
|
||||
}
|
||||
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",
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -28,6 +28,7 @@ locals {
|
||||
"ttrss",
|
||||
"vaultwarden",
|
||||
"wikijs",
|
||||
"vikunja",
|
||||
]
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user