homelab/nomad-job/apps/paperless-ng.nomad

112 lines
3.2 KiB
Plaintext
Raw 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"
}
2024-02-21 18:03:31 +00:00
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
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 {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/library/redis"
2022-10-29 08:40:01 +00:00
ports = ["redis"]
2022-09-04 14:42:51 +00:00
}
resources {
2023-09-04 16:53:11 +00:00
memory = 50
2024-08-03 12:46:05 +00:00
cpu = 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",
2024-10-12 08:12:38 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.middlewares=authelia",
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 {
2024-03-17 17:58:24 +00:00
image = "ghcr.service.consul:5000/paperless-ngx/paperless-ngx"
2022-09-04 14:42:51 +00:00
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"
2024-10-12 08:12:38 +00:00
PAPERLESS_ENABLE_HTTP_REMOTE_USER = "true"
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_REMOTE_USER"
PAPERLESS_LOGOUT_REDIRECT_URL= "https://auth.ducamps.eu/logout"
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
2024-03-17 09:40:20 +00:00
memory_max = 1500
2024-08-03 12:46:05 +00:00
cpu = 100
2022-09-04 14:42:51 +00:00
}
}
}
}