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
This commit is contained in:
Márton Szücs
2024-06-29 18:52:06 +02:00
parent 0fb8cf4241
commit ac887eefd6
2 changed files with 72 additions and 0 deletions

View File

@@ -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