From c017b422d541091f19edd7be09da3e8660103e82 Mon Sep 17 00:00:00 2001 From: Mitchell-Johnson Date: Sun, 20 Sep 2026 07:50:43 -0700 Subject: [PATCH] Docker: new stacks and containers, stack down/delete, container remove, image pull/remove/prune MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new stack is a folder in a home (where stacks are already kept: Dockhand's group here, ~/stacks elsewhere) with compose.yaml and an optional root-only .env, validated by compose before it is kept and deployed the way its neighbours were — inside dockhand, or to a node over tcp from the hub. New container is the same dialog on a form that writes the compose. Homes are scanned, so undeployed stacks stay listed. Delete moves a stack's files to .hamlab-trash; nothing is forced, and volumes and data are never touched. Co-Authored-By: Claude Fable 5.1 --- PLAN.md | 18 +- internal/api/docker.go | 67 +++++++- internal/api/server.go | 9 + internal/api/stacks.go | 372 ++++++++++++++++++++++++++++++++++++++++- web/src/Docker.tsx | 43 +++-- web/src/StackNew.tsx | 93 +++++++++++ web/src/api.ts | 11 +- web/src/styles.css | 9 + 8 files changed, 605 insertions(+), 17 deletions(-) create mode 100644 web/src/StackNew.tsx diff --git a/PLAN.md b/PLAN.md index 898d6a9..e1391bb 100644 --- a/PLAN.md +++ b/PLAN.md @@ -223,7 +223,23 @@ something long in one, switch away and back, refresh — it's all still there. last deploy from here, `.hamlab-deployed`, else the copy the last save replaced; `.env` values never shown), and **image update checks** — asked for, never polled, since each is a registry request Docker Hub counts; remembered six hours. A save refuses a - file changed on disk meanwhile. Removing containers, images and volumes is still absent. + file changed on disk meanwhile. + **Making and unmaking (2026-09-20):** "+ New stack" — a name, a folder, compose text and + an optional `.env` (written root-only), checked by compose before it is kept, then + "Create and deploy" or "Create only". "+ New container" is the same dialog opened on a + form (image, ports, volumes, environment, restart, command, host networking) that writes + the compose for you: a container made here is a one-service stack, so it stays editable + and redeployable, where a bare `docker run` could only be thrown away and typed again. + New stacks go in a **home** — a folder where two or more stacks are already deployed from + (Dockhand's `stacks/core` here; `~/stacks` on a machine with none) — and are deployed the + way their neighbours were (inside `dockhand`, or over tcp to a node from the hub). Homes + are also scanned, so a stack with no containers ("not deployed": never deployed, or taken + down) is still listed. **Down** removes a stack's containers; **Delete…** (type its name) + takes it down and moves its own files to `/.hamlab-trash/-