mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-12-06 12:28:50 +00:00
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:
+9
-6
@@ -15,7 +15,7 @@ budgets, and transaction management.
|
||||
|
||||
## 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`,
|
||||
`sheets/`, and a `.gitignore`. Edit `paisa.yaml` to suit you.
|
||||
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_RESTART – restart policy (default unless-stopped)
|
||||
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)
|
||||
|
||||
## 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.
|
||||
|
||||
- `/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
|
||||
host, backed up by restic
|
||||
|
||||
Both default to `/data`, so they start out as the same folder. Change
|
||||
them in the stack's env in Dockhand to split them.
|
||||
Both default to `/data/paisa`, so they start out as the same folder.
|
||||
`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
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ services:
|
||||
restart: ${PAISA_RESTART:-unless-stopped}
|
||||
|
||||
volumes:
|
||||
- ${VOL_PROJECTS:-/data}/paisa:/root/Documents/paisa
|
||||
- ${PAISA_LEDGER_PATH:-/data/paisa}:/root/Documents/paisa
|
||||
- ${VOL_PATH:-/data}/paisa:/var/lib/paisa
|
||||
|
||||
ports:
|
||||
|
||||
+13
-18
@@ -115,38 +115,33 @@ loan, a credit card, and a savings transfer toward an excavator fund.
|
||||
|
||||
| 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 |
|
||||
|
||||
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
|
||||
|
||||
1. From the root of this repo, copy the demo into its own folder, keeping
|
||||
your real books separate:
|
||||
1. Clone this repo somewhere on the Docker host, e.g.:
|
||||
```bash
|
||||
mkdir -p /data/demo
|
||||
cp -r paisa/demo /data/demo/paisa
|
||||
cd /data/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
|
||||
VOL_PROJECTS=/data/demo
|
||||
VOL_PATH=/data/demo-db
|
||||
PAISA_LEDGER_PATH=/data/paisa/docker-compose-cookbooks/paisa/demo
|
||||
```
|
||||
The compose file appends `/paisa`, so the ledger comes from
|
||||
`/data/demo/paisa` and the database is written to `/data/demo-db/paisa`.
|
||||
The path is used as-is, so the ledger comes straight from the clone.
|
||||
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
|
||||
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
|
||||
|
||||
Set `VOL_PROJECTS` and `VOL_PATH` back to your values (default `/data`)
|
||||
and redeploy. The demo database in `/data/demo-db` can be deleted at any
|
||||
time; Paisa rebuilds it from the ledger files.
|
||||
Set `PAISA_LEDGER_PATH` back to your books (default `/data/paisa`) and
|
||||
redeploy. Paisa rebuilds `paisa.db` from the ledger files, so the demo
|
||||
data in it is replaced on the next sync.
|
||||
|
||||
## Start your own books
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
PAISA_IMAGE=ananthakumaran/paisa:latest
|
||||
PAISA_RESTART=unless-stopped
|
||||
VOL_PATH=/data
|
||||
VOL_PROJECTS=/data
|
||||
PAISA_LEDGER_PATH=/data/paisa
|
||||
PAISA_PORT=7500
|
||||
|
||||
Reference in New Issue
Block a user