nixos-servers/docker_swarm/roles/paperless-ngx/docker-stack.yml.j2
2024-02-08 23:53:02 +01:00

113 lines
3.5 KiB
Django/Jinja

# vi: ft=yaml
# Docker Compose file for running paperless from the Docker Hub.
# This file contains everything paperless needs to run.
# Paperless supports amd64, arm and arm64 hardware.
#
# All compose files of paperless configure paperless in the following way:
#
# - Paperless is (re)started on system boot, if it was running before shutdown.
# - Docker volumes for storing data are managed by Docker.
# - Folders for importing and exporting files are created in the same directory
# as this file and mounted to the correct folders inside the container.
# - Paperless listens on port 8000.
#
# In addition to that, this Docker Compose file adds the following optional
# configurations:
#
# - Instead of SQLite (default), PostgreSQL is used as the database server.
#
# To install and update paperless with this file, do the following:
#
# - Copy this file as 'docker-compose.yml' and the files 'docker-compose.env'
# and '.env' into a folder.
# - Run 'docker compose pull'.
# - Run 'docker compose run --rm webserver createsuperuser' to create a user.
# - Run 'docker compose up -d'.
#
# For more extensive installation and update instructions, refer to the
# documentation.
version: "3.7"
networks:
traefik:
external: true
paperless-ngx:
volumes:
data:
driver_opts:
type: "nfs"
o: "addr=lewis.dmz,nolock,soft,rw"
device: ":/mnt/data/nfs/paperless-ngx/data"
redisdata:
driver_opts:
type: "nfs"
o: "addr=lewis.dmz,nolock,soft,rw"
device: ":/mnt/data/nfs/paperless-ngx/redisdata"
nextcloud:
driver_opts:
type: "nfs"
o: "addr=lewis.dmz,nolock,soft,rw"
device: ":/mnt/data/nfs/nextcloud/data"
services:
broker:
image: docker.io/library/redis:7
volumes:
- type: volume
source: redisdata
target: /data
volume:
nocopy: true
networks:
- paperless-ngx
webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:2.3
depends_on:
- broker
volumes:
- type: volume
source: data
target: /data
volume:
nocopy: true
# TODO: what does this directory even do?
# - ./export:/usr/src/paperless/export
- type: volume
source: nextcloud
target: /nextcloud
volume:
nocopy: true
environment:
PAPERLESS_REDIS: redis://broker:6379
PAPERLESS_DBENGINE: postgresql
PAPERLESS_DBHOST: lewis.dmz
PAPERLESS_DBNAME: paperless
PAPERLESS_DBUSER: paperless
PAPERLESS_DBPASS: "{{ paperless_db_password }}"
PAPERLESS_CONSUMPTION_DIR: /nextcloud/data/pim/files/paperless-ngx/consumption/
PAPERLESS_DATA_DIR: /data/
PAPERLESS_MEDIA_ROOT: /data/
PAPERLESS_CONSUMER_POLLING: 10
PAPERLESS_OCR_LANGUAGES: nld eng
PAPERLESS_URL: https://paperless.kun.is
PAPERLESS_TIME_ZONE: Europe/Amsterdam
PAPERLESS_OCR_LANGUAGE: nld
PAPERLESS_SECRET_KEY: "{{ paperless_secret_key }}"
USERMAP_UID: "33"
USERMAP_GID: "33"
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.paperless-ngx.entrypoints=websecure
- traefik.http.routers.paperless-ngx.rule=Host(`paperless.kun.is`)
- traefik.http.routers.paperless-ngx.tls=true
- traefik.http.routers.paperless-ngx.tls.certresolver=letsencrypt
- traefik.http.routers.paperless-ngx.service=paperless-ngx
- traefik.http.services.paperless-ngx.loadbalancer.server.port=8000
- traefik.docker.network=traefik
networks:
- traefik
- paperless-ngx