- CASHBOOK_PASSWORD is now optional; without it there's no login and the server logs a warning - Origin check compares host names only, and also accepts X-Forwarded-Host and CASHBOOK_ALLOWED_HOSTS, so changes work when the app is reached by IP, on another port or through a proxy; refusals are logged with the reason and explained in the error - Add a favicon so browsers stop requesting a missing /favicon.ico Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
services:
|
|
cashbook:
|
|
build: .
|
|
image: accounts-cashbook:latest
|
|
init: true
|
|
restart: unless-stopped
|
|
stop_grace_period: 20s
|
|
|
|
# Run as the owner of ./data so saved books stay owned by them on the host.
|
|
# Rootless Docker maps container root to you instead: set CASHBOOK_USER=0:0.
|
|
user: "${CASHBOOK_USER:-1000:1000}"
|
|
|
|
# Only published on localhost by default; put a TLS reverse proxy in front
|
|
# to reach it from elsewhere (set CASHBOOK_BIND=0.0.0.0 only behind a firewall).
|
|
ports:
|
|
- "${CASHBOOK_BIND:-127.0.0.1}:${CASHBOOK_PORT:-8765}:8765"
|
|
|
|
# Browser login (HTTP Basic): set CASHBOOK_PASSWORD in .env. Leave it unset to turn
|
|
# the login off; then anyone who can reach the port can see and change your books.
|
|
environment:
|
|
CASHBOOK_USERNAME: "${CASHBOOK_USERNAME:-cashbook}"
|
|
CASHBOOK_PASSWORD: "${CASHBOOK_PASSWORD:-}"
|
|
# other host names you reach it by, if the proxy doesn't pass Host through
|
|
CASHBOOK_ALLOWED_HOSTS: "${CASHBOOK_ALLOWED_HOSTS:-}"
|
|
|
|
volumes:
|
|
# cashbooks and statements/ (uploads go there too)
|
|
- ./data:/data
|
|
# optional: a folder of ANZ exports to pick from, read-only
|
|
# - /path/to/anz:/statements:ro
|
|
|
|
# Locked down: read-only image, scratch space in /tmp, no extra privileges
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:size=512m,mode=1777
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 10m
|
|
max-file: "3"
|