homelab/nomad-job/decom/wikijs.nomad

77 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

2022-05-17 19:14:10 +00:00
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{
2022-10-30 08:33:39 +00:00
policies= ["wikijs"]
2022-05-17 19:14:10 +00:00
}
task "wikijs" {
driver = "docker"
service {
name = "wikijs"
port = "http"
tags = [
2022-05-23 19:44:34 +00:00
"homer.enable=true",
"homer.name=wikiJS",
"homer.service=Application",
"homer.subtitle=projet Infotech",
"homer.logo=https://repository-images.githubusercontent.com/65848095/7655d480-b066-11e9-991b-81088c474331",
"homer.target=_blank",
2023-11-05 18:08:17 +00:00
"homer.url=https://${NOMAD_JOB_NAME}.ducamps.eu",
2022-05-23 19:44:34 +00:00
2022-05-17 19:14:10 +00:00
"traefik.enable=true",
2023-11-05 18:08:17 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.eu`)",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.eu",
2022-05-17 19:14:10 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
]
}
config {
image = "ducampsv/wikijs"
ports = ["http"]
volumes = [
]
}
env {
}
template {
data= <<EOH
2022-10-30 08:33:39 +00:00
{{ with secret "secrets/data/database/wikijs"}}
2022-05-17 19:14:10 +00:00
DB_TYPE="postgres"
2023-11-01 07:42:04 +00:00
DB_HOST="active.db.service.consul"
2022-05-17 19:14:10 +00:00
DB_PORT="5432"
DB_USER="wikijs"
2022-10-30 08:33:39 +00:00
DB_PASS="{{.Data.data.password}}"
2022-05-17 19:14:10 +00:00
DB_NAME="wikijs"
{{end}}
EOH
destination = "secrets/wikijs.env"
env = true
}
resources {
cpu = 600
memory = 400
}
}
}
}