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; compose won't start without it. environment: CASHBOOK_USERNAME: "${CASHBOOK_USERNAME:-cashbook}" CASHBOOK_PASSWORD: "${CASHBOOK_PASSWORD:?set CASHBOOK_PASSWORD in .env}" 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"