homelab/nomad-job/paperless-ng.nomad

102 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

2022-09-04 14:42:51 +00:00
job "paperless-ng" {
datacenters = ["homelab"]
2022-12-10 16:10:32 +00:00
priority = 70
2022-10-29 08:40:01 +00:00
type = "service"
2022-09-04 14:42:51 +00:00
meta {
forcedeploy = "0"
}
2022-10-29 08:40:01 +00:00
2022-09-04 14:42:51 +00:00
constraint {
attribute = "${attr.cpu.arch}"
2022-10-29 08:40:01 +00:00
value = "amd64"
2022-09-04 14:42:51 +00:00
}
2022-10-29 08:40:01 +00:00
group "paperless-ng" {
2022-09-04 14:42:51 +00:00
network {
mode = "host"
port "http" {
to = 8000
}
port "redis" {
to = 6379
}
}
2022-10-29 08:40:01 +00:00
vault {
2022-10-30 08:33:39 +00:00
policies = ["paperless"]
2022-09-04 14:42:51 +00:00
}
task "redis" {
driver = "docker"
config {
2022-10-29 08:40:01 +00:00
image = "redis"
ports = ["redis"]
2022-09-04 14:42:51 +00:00
}
resources {
2023-09-04 16:53:11 +00:00
memory = 50
2022-09-04 14:42:51 +00:00
}
}
task "paperless-ng" {
driver = "docker"
service {
name = "${JOB}"
port = "http"
tags = [
2022-10-29 08:40:01 +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-10-29 08:40:01 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
2023-10-07 16:40:40 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure",
2022-10-29 08:40:01 +00:00
"homer.enable=true",
"homer.name=Paperless",
"homer.service=Application",
2023-11-05 18:08:17 +00:00
"homer.logo=https://${NOMAD_JOB_NAME}.ducamps.eu/static/frontend/fr-FR/apple-touch-icon.png",
2022-10-29 08:40:01 +00:00
"homer.target=_blank",
2023-11-05 18:08:17 +00:00
"homer.url=https://${NOMAD_JOB_NAME}.ducamps.eu",
2022-09-04 14:42:51 +00:00
]
check {
2022-10-29 08:40:01 +00:00
type = "http"
name = "paperless-ng_health"
path = "/"
2022-09-04 14:42:51 +00:00
interval = "30s"
2022-10-29 08:40:01 +00:00
timeout = "5s"
2022-09-04 14:42:51 +00:00
}
}
config {
image = "ghcr.io/paperless-ngx/paperless-ngx"
ports = ["http"]
volumes = [
"/mnt/diskstation/nomad/paperless-ng/media:/usr/src/paperless/media",
"/mnt/diskstation/nomad/paperless-ng/data:/usr/src/paperless/data",
"/mnt/diskstation/nomad/paperless-ng/export:/usr/src/paperless/export",
"/mnt/diskstation/nomad/paperless-ng/consume:/usr/src/paperless/consume",
]
}
env {
2022-10-29 08:40:01 +00:00
PAPERLESS_REDIS = "redis://${NOMAD_ADDR_redis}"
2023-11-01 07:42:04 +00:00
PAPERLESS_DBHOST = "active.db.service.consul"
2022-10-29 08:40:01 +00:00
PAPERLESS_DBNAME = "paperless"
PAPERLESS_DBUSER = "paperless"
PAPERLESS_OCR_LANGUAGE = "fra"
PAPERLESS_CONSUMER_POLLING = "60"
2023-11-05 18:08:17 +00:00
PAPERLESS_URL = "https://${NOMAD_JOB_NAME}.ducamps.eu"
2023-05-22 06:56:52 +00:00
PAPERLESS_ALLOWED_HOSTS = "192.168.1.42,192.168.1.40"
2022-09-04 14:42:51 +00:00
}
template {
2022-10-29 08:40:01 +00:00
data = <<EOH
2022-10-30 08:33:39 +00:00
PAPERLESS_DBPASS= {{ with secret "secrets/data/database/paperless"}}{{.Data.data.password }}{{end}}
2022-09-04 14:42:51 +00:00
EOH
destination = "secrets/paperless.env"
2022-10-29 08:40:01 +00:00
env = true
2022-09-04 14:42:51 +00:00
}
resources {
2023-08-17 08:06:28 +00:00
memory = 950
2022-10-29 08:40:01 +00:00
cpu = 2000
2022-09-04 14:42:51 +00:00
}
}
}
}