From d558c5a4d4cd22e880cdc27c783582e6b383712b Mon Sep 17 00:00:00 2001 From: wizzdom Date: Tue, 22 Oct 2024 03:54:41 +0100 Subject: [PATCH] add paperless --- jobs/services/paperless.hcl | 118 ++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 jobs/services/paperless.hcl diff --git a/jobs/services/paperless.hcl b/jobs/services/paperless.hcl new file mode 100644 index 0000000..b0ee2f4 --- /dev/null +++ b/jobs/services/paperless.hcl @@ -0,0 +1,118 @@ +job "paperless" { + datacenters = ["aperture"] + type = "service" + + group "paperless-web" { + network { + port "http" { + to = 8000 + } + port "redis" { + to = 6379 + } + port "db" { + to = 5432 + } + } + + service { + name = "paperless" + port = "http" + + check { + type = "http" + path = "/" + interval = "10s" + timeout = "2s" + } + + tags = [ + "traefik.enable=true", + "traefik.http.routers.paperless.rule=Host(`paperless.redbrick.dcu.ie`) || Host(`paperless.rb.dcu.ie`)", + "traefik.http.routers.paperless.entrypoints=websecure", + "traefik.http.routers.paperless.tls=true", + "traefik.http.routers.paperless.tls.certresolver=lets-encrypt", + "traefik.http.middlewares.paperless.headers.contentSecurityPolicy=default-src 'self'; img-src 'self' data:" + ] + } + + task "web" { + driver = "docker" + + config { + image = "ghcr.io/paperless-ngx/paperless-ngx:latest" + ports = ["http"] + + volumes = [ + "/storage/nomad/paperless/consume:/usr/src/paperless/consume", + "/storage/nomad/paperless/data:/usr/src/paperless/data", + "/storage/nomad/paperless/media:/usr/src/paperless/media", + "/storage/nomad/paperless/export:/usr/src/paperless/export", + "/storage/nomad/paperless/preconsume:/usr/src/paperless/preconsume", + ] + } + + template { + data = <