homelab/nomad-job/decom/wikijs.nomad

77 lines
1.6 KiB
Plaintext
Raw 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{
policies= ["access-tables"]
}
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",
"homer.url=https://${NOMAD_JOB_NAME}.ducamps.win",
2022-05-17 19:14:10 +00:00
"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",
]
}
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
}
}
}
}