paisa: PAISA_LEDGER_PATH full-path ledger mount for in-repo demo; fix DB volume

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
code
2026-11-22 17:08:54 +00:00
co-authored by Claude Opus 5.5
parent 3d4b625f3d
commit 46cbd3b447
5 changed files with 25 additions and 26 deletions
+1
View File
@@ -32,6 +32,7 @@ These deliberately violate the conventions above — do not "fix" them:
- `pangolin_dev` is itself an edge reverse proxy (Pangolin + gerbil + traefik), not a client of NPM; the `proxy` network is declared for convention but unused by its services, and `traefik` uses `network_mode: service:gerbil` instead of joining `internal` - `pangolin_dev` is itself an edge reverse proxy (Pangolin + gerbil + traefik), not a client of NPM; the `proxy` network is declared for convention but unused by its services, and `traefik` uses `network_mode: service:gerbil` instead of joining `internal`
- `zammad_dev` `zammad-init` service hardcodes `restart: on-failure` (init container) - `zammad_dev` `zammad-init` service hardcodes `restart: on-failure` (init container)
- `nextcloud/compose-aio.yaml` follows the upstream AIO layout: fixed container/volume names, no env templating, no proxy network - `nextcloud/compose-aio.yaml` follows the upstream AIO layout: fixed container/volume names, no env templating, no proxy network
- `paisa` mounts its ledger repo from `${PAISA_LEDGER_PATH:-/data/paisa}` (a full path, not `VOL_PROJECTS`) so it can point at any folder, e.g. `paisa/demo` in a clone of this repo
- `opencode` and `vscode` default `VOL_PROJECTS` to `${VOL_PATH:-/data}/projects` (nested default), not plain `/data` - `opencode` and `vscode` default `VOL_PROJECTS` to `${VOL_PATH:-/data}/projects` (nested default), not plain `/data`
- `mailu_dev` passes env via `env_file: .env`, so its sample.env holds vars the compose file never references - `mailu_dev` passes env via `env_file: .env`, so its sample.env holds vars the compose file never references
- `headscale` sample.env documents `HEADSCALE_DOMAIN`/`HEADSCALE_URL` for the config file even though compose doesn't use them - `headscale` sample.env documents `HEADSCALE_DOMAIN`/`HEADSCALE_URL` for the config file even though compose doesn't use them
+9 -6
View File
@@ -15,7 +15,7 @@ budgets, and transaction management.
## Getting Started ## Getting Started
1. Copy this stack's `config/` folder to `${VOL_PROJECTS:-/data}/paisa` 1. Copy this stack's `config/` folder to `${PAISA_LEDGER_PATH:-/data/paisa}`
and make it a git repo. It holds `paisa.yaml`, an empty `main.ledger`, and make it a git repo. It holds `paisa.yaml`, an empty `main.ledger`,
`sheets/`, and a `.gitignore`. Edit `paisa.yaml` to suit you. `sheets/`, and a `.gitignore`. Edit `paisa.yaml` to suit you.
Starting a new business? Copy `template/` instead: it has a chart of Starting a new business? Copy `template/` instead: it has a chart of
@@ -35,21 +35,24 @@ especially the section on closing entries.
PAISA_IMAGE – container image (default ananthakumaran/paisa:latest) PAISA_IMAGE – container image (default ananthakumaran/paisa:latest)
PAISA_RESTART – restart policy (default unless-stopped) PAISA_RESTART – restart policy (default unless-stopped)
VOL_PATH – host base path for the database, backed up by restic (default /data) VOL_PATH – host base path for the database, backed up by restic (default /data)
VOL_PROJECTS – host base path for the ledger git repo (default /data) PAISA_LEDGER_PATH – full host path of the ledger git repo, not a base path (default /data/paisa)
PAISA_PORT – host port for the web UI (default 7500) PAISA_PORT – host port for the web UI (default 7500)
## Volume Notes ## Volume Notes
Anything that belongs in git goes in `VOL_PROJECTS`; anything that Anything that belongs in git goes in `PAISA_LEDGER_PATH`; anything that
doesn't (the SQLite database) goes in `VOL_PATH`, which is backed up. doesn't (the SQLite database) goes in `VOL_PATH`, which is backed up.
- `/root/Documents/paisa` — `paisa.yaml`, `*.ledger`, `sheets/`; - `/root/Documents/paisa` — `paisa.yaml`, `*.ledger`, `sheets/`;
`${VOL_PROJECTS:-/data}/paisa` on the host, kept in git `${PAISA_LEDGER_PATH:-/data/paisa}` on the host, kept in git
- `/var/lib/paisa` — `paisa.db`; `${VOL_PATH:-/data}/paisa` on the - `/var/lib/paisa` — `paisa.db`; `${VOL_PATH:-/data}/paisa` on the
host, backed up by restic host, backed up by restic
Both default to `/data`, so they start out as the same folder. Change Both default to `/data/paisa`, so they start out as the same folder.
them in the stack's env in Dockhand to split them. `PAISA_LEDGER_PATH` is a full path (nothing is appended), so it can point
anywhere, such as the `demo/` folder in a clone of this repo. The
database location comes from `db_path` in `paisa.yaml`
(`/var/lib/paisa/paisa.db`), so it never lands in the ledger repo.
## Network Notes ## Network Notes
+1 -1
View File
@@ -6,7 +6,7 @@ services:
restart: ${PAISA_RESTART:-unless-stopped} restart: ${PAISA_RESTART:-unless-stopped}
volumes: volumes:
- ${VOL_PROJECTS:-/data}/paisa:/root/Documents/paisa - ${PAISA_LEDGER_PATH:-/data/paisa}:/root/Documents/paisa
- ${VOL_PATH:-/data}/paisa:/var/lib/paisa - ${VOL_PATH:-/data}/paisa:/var/lib/paisa
ports: ports:
+13 -18
View File
@@ -115,38 +115,33 @@ loan, a credit card, and a savings transfer toward an excavator fund.
| Data | Host path | In git? | | Data | Host path | In git? |
| ----------------------------- | ---------------------------- | ------- | | ----------------------------- | ---------------------------- | ------- |
| `paisa.yaml`, `*.ledger` | `${VOL_PROJECTS:-/data}/paisa` | Yes | | `paisa.yaml`, `*.ledger` | `${PAISA_LEDGER_PATH:-/data/paisa}` | Yes |
| `paisa.db` (SQLite) | `${VOL_PATH:-/data}/paisa` | No, backed up by restic | | `paisa.db` (SQLite) | `${VOL_PATH:-/data}/paisa` | No, backed up by restic |
Both variables default to `/data`, so out of the box both are `/data/paisa`. Out of the box both are `/data/paisa`.
## Load the demo ## Load the demo
1. From the root of this repo, copy the demo into its own folder, keeping 1. Clone this repo somewhere on the Docker host, e.g.:
your real books separate:
```bash ```bash
mkdir -p /data/demo cd /data/paisa
cp -r paisa/demo /data/demo/paisa git clone https://github.com/nickyeoman/docker-compose-cookbooks.git
``` ```
2. In Dockhand, edit the stack's environment variables: 2. In Dockhand, set the stack's environment variable to the demo folder:
```env ```env
VOL_PROJECTS=/data/demo PAISA_LEDGER_PATH=/data/paisa/docker-compose-cookbooks/paisa/demo
VOL_PATH=/data/demo-db
``` ```
The compose file appends `/paisa`, so the ledger comes from The path is used as-is, so the ledger comes straight from the clone.
`/data/demo/paisa` and the database is written to `/data/demo-db/paisa`. The database stays in `${VOL_PATH:-/data}/paisa` (from `db_path` in
`demo/paisa.yaml`).
3. Redeploy the stack and open http://localhost:7500 (or the host's 3. Redeploy the stack and open http://localhost:7500 (or the host's
address or proxy hostname if you're not on the Docker host). address or proxy hostname if you're not on the Docker host).
4. Optional: make it a git repo to try the workflow:
```bash
cd /data/demo/paisa && git init && git add . && git commit -m "Demo books"
```
## Switch back to your own books ## Switch back to your own books
Set `VOL_PROJECTS` and `VOL_PATH` back to your values (default `/data`) Set `PAISA_LEDGER_PATH` back to your books (default `/data/paisa`) and
and redeploy. The demo database in `/data/demo-db` can be deleted at any redeploy. Paisa rebuilds `paisa.db` from the ledger files, so the demo
time; Paisa rebuilds it from the ledger files. data in it is replaced on the next sync.
## Start your own books ## Start your own books
+1 -1
View File
@@ -1,5 +1,5 @@
PAISA_IMAGE=ananthakumaran/paisa:latest PAISA_IMAGE=ananthakumaran/paisa:latest
PAISA_RESTART=unless-stopped PAISA_RESTART=unless-stopped
VOL_PATH=/data VOL_PATH=/data
VOL_PROJECTS=/data PAISA_LEDGER_PATH=/data/paisa
PAISA_PORT=7500 PAISA_PORT=7500