fix(paperless-ngx): keep SQLite database and index on local disk

Only media/consume/export/trash stay on the UNAS share; SQLite over
NFS risks lock contention and corruption.
This commit is contained in:
Brian Pooe 2026-07-03 18:38:50 +02:00
parent d20500c5be
commit cc6cdebba2
2 changed files with 21 additions and 19 deletions

View file

@ -6,19 +6,22 @@ task broker.
## Persistent Data
All document state lives on the UNAS `paperless_data` share (see
[nfs-mounts](../../docs/unas/nfs-mounts.md)), NFS-mounted on the Proxmox host
and bind-mounted into the LXC at `PAPERLESS_DATA_ROOT`:
Split between local disk and the UNAS `paperless_data` share (see
[nfs-mounts](../../docs/unas/nfs-mounts.md)):
- `data/` — database, search index, classification model.
- `media/` — original and archived documents.
- `consume/` — watched for new documents; safe to empty once ingested.
- `export/` — target for `document_exporter` backups.
- `trash/` — deleted documents until emptied.
- `paperless_data` named volume (local disk) — SQLite database, search index,
and classification model. Kept off NFS because SQLite file locking over NFS
risks corruption and slow queries.
- Share dirs, NFS-mounted on the Proxmox host and bind-mounted into the LXC
at `PAPERLESS_DATA_ROOT`:
- `media/` — original and archived documents.
- `consume/` — watched for new documents; safe to empty once ingested.
- `export/` — target for `document_exporter` backups.
- `trash/` — deleted documents until emptied.
The compose binds use `create_host_path: false`, so the stack refuses to start
if the share is not mounted. Only the Redis broker state is in a Docker named
volume (`paperless_redis_data`).
The share binds use `create_host_path: false`, so the stack refuses to start
if the share is not mounted. Redis broker state is in the
`paperless_redis_data` named volume.
## Installation

View file

@ -51,17 +51,15 @@ services:
# `createsuperuser` manually instead).
PAPERLESS_ADMIN_USER: "{{PAPERLESS_ADMIN_USER:-}}"
PAPERLESS_ADMIN_PASSWORD: "{{PAPERLESS_ADMIN_PASSWORD:-}}"
# Database, search index, and classifier live in the paperless_data named
# volume on local disk — SQLite over NFS risks lock/corruption issues.
# PAPERLESS_DATA_ROOT is the UNAS paperless_data share (bind-mounted into
# the LXC) holding data/, media/, consume/, export/, and trash/.
# create_host_path: false refuses to start if the share is not mounted,
# instead of silently writing to an empty directory.
# the LXC) holding only the document dirs: media/, consume/, export/, and
# trash/. create_host_path: false refuses to start if the share is not
# mounted, instead of silently writing to an empty directory.
volumes:
- /etc/localtime:/etc/localtime:ro
- type: bind
source: {{PAPERLESS_DATA_ROOT}}/data
target: /usr/src/paperless/data
bind:
create_host_path: false
- paperless_data:/usr/src/paperless/data
- type: bind
source: {{PAPERLESS_DATA_ROOT}}/media
target: /usr/src/paperless/media
@ -114,3 +112,4 @@ networks:
volumes:
paperless_redis_data:
paperless_data: