Files
Trilium/docker-compose.yml
Elian DoranandClaude Opus 5.5 0a2b7d7064 fix(docker): mount the data directory relative to the compose file
The volume read `${TRILIUM_DATA_DIR:-~/trilium-data}`, where Compose
fills in `TRILIUM_DATA_DIR` from the host shell or `.env`. The same name
is the in-container data path everywhere else (the images' `ENV`, the
compose `environment:` block, the docs' env-var list), so users who set
it to `/home/node/trilium-data` as the docs described got a bind mount of
a non-existent host directory.

The volume is now `./trilium-data:<container path>`, the pattern
Vaultwarden and Gitea use. It needs no variable and resolves the same
whoever runs compose, unlike `~`, which becomes `/root` under sudo.
Existing installs keep their downloaded copy, so they are unaffected.

Also drops the `TRILIUM_DATA_DIR` environment entry the images already
set, and in the rootless file the obsolete `version:` key, the no-op
`TRILIUM_VARIANT` hint and the pre-rename `triliumnext/notes` image name.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-29 19:45:05 +03:00

23 lines
1.2 KiB
YAML

# Running `docker-compose up` will create/use the "trilium-data" directory next to this file
# To run in the background, use `docker-compose up -d`
services:
trilium:
# Optionally, replace `latest` with a version tag like `v0.90.3`
# Using `latest` may cause unintended updates to the container
image: triliumnext/trilium:latest
# Restart the container unless it was stopped by the user
restart: unless-stopped
ports:
# By default, Trilium will be available at http://localhost:8080
# It will also be accessible at http://<host-ip>:8080
# You might want to limit this with something like Docker Networks, reverse proxies, or firewall rules,
# however be aware that using UFW is known to not work with default Docker installations, see:
# https://docs.docker.com/engine/network/packet-filtering-firewalls/#docker-and-ufw
- '8080:8080'
volumes:
# Trilium stores its data in `trilium-data` next to this file. To use another directory
# on the host, change the part before the colon only.
- ./trilium-data:/home/node/trilium-data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro