Default STACKS_HOST_DIR to /opt/stacks so host and container paths match

The shipped default (./data/stacks) guarantees the mismatch that hid stack data
from the file browser, the editor and (before 0.40.0) from backups: compose
resolves ./config against the container path, so the daemon creates the data
directories at /opt/stacks/<stack>/... on the host regardless of where
STACKS_HOST_DIR points. Same change for the agent, plus the reasoning in
.env.example and the README config table. Images unchanged (0.40.1).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-08-16 18:35:22 +00:00
co-authored by Claude Opus 5
parent 4c158e9407
commit 6af02a1367
4 changed files with 26 additions and 5 deletions
+9 -1
View File
@@ -415,7 +415,15 @@ most important ones:
| `DATA_DIR` | `/data` | SQLite DB + app data |
| `CORS_ORIGINS` | localhost | Allowed API origins (comma separated) |
The host path for stacks is set via `STACKS_HOST_DIR` in `.env`.
The host path for stacks is set via `STACKS_HOST_DIR` in `.env`, and it should
be **the same path as `STACKS_DIR`** (`/opt/stacks` by default). Compose runs
inside the backend container, so a stack's relative bind mounts (`./config`) are
resolved against the container path and the daemon creates those directories at
that path *on the host*. Point `STACKS_HOST_DIR` somewhere else and every stack's
data lives at `/opt/stacks/<stack>/…` on the host while StackPilot looks at a
different folder — the file browser and editor then show only the compose file.
Backups cover the data either way (they read bind sources by host path through a
helper container) and the Backup dialog warns when the two paths diverge.
## Local development