add wikijs

This commit is contained in:
vincent 2022-05-17 21:14:10 +02:00
parent 1a1bcaa81d
commit 21f275a07a

70
wikijs.nomad Normal file
View File

@ -0,0 +1,70 @@
job "wikijs" {
datacenters = ["homelab"]
type = "service"
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
}
meta {
forcedeploy = "3"
}
group "wikijs"{
network {
mode = "host"
port "http" {
to = 3000
}
}
vault{
policies= ["access-tables"]
}
task "wikijs" {
driver = "docker"
service {
name = "wikijs"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`)",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
"traefik.http.routers.${NOMAD_JOB_NAME}_insecure.middlewares=httpsRedirect",
"traefik.http.routers.${NOMAD_JOB_NAME}_insecure.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`)",
]
}
config {
image = "ducampsv/wikijs"
ports = ["http"]
volumes = [
]
}
env {
}
template {
data= <<EOH
{{ with secret "secrets/data/wikijs"}}
DB_TYPE="postgres"
DB_HOST="db1.ducamps.win"
DB_PORT="5432"
DB_USER="wikijs"
DB_PASS="{{.Data.data.DB_PASS}}"
DB_NAME="wikijs"
{{end}}
EOH
destination = "secrets/wikijs.env"
env = true
}
resources {
cpu = 600
memory = 400
}
}
}
}