services: cashbook: build: . image: accounts-cashbook:latest init: true restart: unless-stopped stop_grace_period: 20s # Run as the owner of ./data so saved files 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 an HTTPS reverse proxy in front # to reach it from elsewhere (set CASHBOOK_BIND=0.0.0.0 only on a trusted network). ports: - "${CASHBOOK_BIND:-127.0.0.1}:${CASHBOOK_PORT:-8765}:8765" # Settings come from .env next to this file; see .env.example environment: AUTH_ENABLED: "${AUTH_ENABLED:-true}" AUTH_REGISTER_OPEN: "${AUTH_REGISTER_OPEN:-true}" AUTH_INVITE_ONLY: "${AUTH_INVITE_ONLY:-true}" AUTH_SESSION_DAYS: "${AUTH_SESSION_DAYS:-14}" BOOTSTRAP_ADMIN_USERNAME: "${BOOTSTRAP_ADMIN_USERNAME:-}" BOOTSTRAP_ADMIN_PASSWORD: "${BOOTSTRAP_ADMIN_PASSWORD:-}" PUBLIC_BASE_URL: "${PUBLIC_BASE_URL:-}" SMTP_HOST: "${SMTP_HOST:-}" SMTP_PORT: "${SMTP_PORT:-587}" SMTP_USER: "${SMTP_USER:-}" SMTP_PASSWORD: "${SMTP_PASSWORD:-}" SMTP_FROM: "${SMTP_FROM:-}" SMTP_TLS: "${SMTP_TLS:-true}" CASHBOOK_ALLOWED_HOSTS: "${CASHBOOK_ALLOWED_HOSTS:-}" # proxies trusted for X-Forwarded-Proto (e.g. your reverse proxy's address) FORWARDED_ALLOW_IPS: "${FORWARDED_ALLOW_IPS:-127.0.0.1}" volumes: # cashbook.db (books and accounts) 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"