From ac887eefd67e6ca09d7ea7660ff0c982bf060d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Sz=C3=BCcs?= <2458236+martonsz@users.noreply.github.com> Date: Sat, 29 Jun 2024 18:52:06 +0200 Subject: [PATCH] Adding service for paperless fulfills: https://github.com/coollabsio/coolify/discussions/2349 This service is using a workaround for the issue mentioned here: https://github.com/coollabsio/coolify/discussions/2572 --- public/svgs/paperless.svg | 12 +++++++ templates/compose/paperless.yaml | 60 ++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 public/svgs/paperless.svg create mode 100644 templates/compose/paperless.yaml diff --git a/public/svgs/paperless.svg b/public/svgs/paperless.svg new file mode 100644 index 0000000000..347b1e759b --- /dev/null +++ b/public/svgs/paperless.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/templates/compose/paperless.yaml b/templates/compose/paperless.yaml new file mode 100644 index 0000000000..cb5f1ca76a --- /dev/null +++ b/templates/compose/paperless.yaml @@ -0,0 +1,60 @@ +# documentation: https://docs.paperless-ngx.com/configuration/ +# slogan: Paperless-ngx is a community-supported open-source document management system that transforms your physical documents into a searchable online archive so you can keep, well, less paper. +# logo: svgs/paperless.svg +# port: 8000 +services: + redis: + image: docker.io/library/redis:${REDIS_TAG:-7.2.5} + restart: unless-stopped + volumes: + - redis:/data + healthcheck: + test: ["CMD", "redis-cli", "ping"] + timeout: 10s + retries: 3 + + paperless: + image: paperlessngx/paperless-ngx:${PAPERLESS_TAG:-2.10.2} + restart: unless-stopped + depends_on: + redis: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-fs", "-S", "--max-time", "2", "http://localhost:8000"] + interval: 30s + timeout: 10s + retries: 5 + volumes: + - data:/usr/src/paperless/data + - media:/usr/src/paperless/media + - type: bind + source: ./export + target: /usr/src/paperless/export + is_directory: true + - type: bind + source: ./consume + target: /usr/src/paperless/consume + is_directory: true + - type: bind + source: ./init-workaround.sh + target: /init-workaround.sh + content: | + #!/bin/bash + # Workaround for https://github.com/coollabsio/coolify/discussions/2572 + # Paperless won't start if the PAPERLESS_URL ends with a path. + if [[ "$PAPERLESS_URL" == */ ]]; then + PAPERLESS_URL="${PAPERLESS_URL%/}" + export PAPERLESS_URL + fi + # Run the original entrypoint + # ENTRYPOINT CMD + exec /sbin/docker-entrypoint.sh /usr/local/bin/paperless_cmd.sh + entrypoint: ["/init-workaround.sh"] + environment: + - PAPERLESS_ADMIN_PASSWORD=$SERVICE_PASSWORD_PAPERLESS_ADMIN + - PAPERLESS_ADMIN_USER=${PAPERLESS_ADMIN_USER:-admin} + - PAPERLESS_REDIS=redis://redis:6379 + - PAPERLESS_SECRET_KEY=$SERVICE_PASSWORD_64_PAPERLESSSECRETKEY + - PAPERLESS_URL=${PAPERLESS_URL:-$SERVICE_FQDN_PAPERLESS} + - SERVICE_FQDN_PAPERLESS + \ No newline at end of file