feat: full pi config in containers — git: packages vendored at bake (ignore-scripts), npm shim for runtime installs, dotfiles mount + POST /api/pi-config/resync rebuilds worker+ops images (95% cover, race clean)

This commit is contained in:
Raphael Westphal
2026-08-19 11:00:39 +02:00
parent 910a244376
commit cbf52d2b76
8 changed files with 505 additions and 17 deletions
+5
View File
@@ -12,6 +12,11 @@ RUN apt-get update \
RUN npm install -g --ignore-scripts @earendil-works/pi-coding-agent
# Same npm shim as the worker image (see worker.Dockerfile).
RUN mv /usr/local/bin/npm /usr/local/bin/npm-real
COPY docker/npm-shim /usr/local/bin/npm
RUN chmod +x /usr/local/bin/npm
# Same pi config as workers (dotfiles, filtered; git: packages stripped).
COPY docker/pi-agent/ /root/.pi/agent/
COPY plugin/lvmh-agent.ts /root/.pi/agent/extensions/lvmh-agent.ts
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
# npm shim for headless pi containers: skip lifecycle scripts during package
# installs. pi installs git: packages by running `npm install --omit=dev` in
# each clone; some upstream packages (e.g. husky in rpiv-mono) have
# postinstall scripts that assume a dev machine and fail/crash headless
# installs. --ignore-scripts makes installs safe; runtime code (pure TS/JS
# extensions) does not need lifecycle scripts. Everything else passes through
# to the real npm transparently.
case "$1" in
install|i)
exec /usr/bin/npm-real "$@" --ignore-scripts
;;
*)
exec /usr/bin/npm-real "$@"
;;
esac
+8
View File
@@ -13,6 +13,14 @@ RUN GOBIN=/usr/local/bin go install golang.org/x/tools/gopls@latest || true
RUN npm install -g --ignore-scripts @earendil-works/pi-coding-agent
# npm shim: pi installs git: packages with `npm install`; postinstall
# scripts (husky etc.) crash headless installs. Route installs through
# --ignore-scripts so ALL dotfiles packages (pi-subagents, todo tooling,
# async agents, every extension) survive the bake.
RUN mv /usr/local/bin/npm /usr/local/bin/npm-real
COPY docker/npm-shim /usr/local/bin/npm
RUN chmod +x /usr/local/bin/npm
# User's pi config from dotfiles (settings, skills, agents, extensions,
# APPEND_SYSTEM.md) — synced by deploy.sh from ~/.dotfiles/pi/agent (filtered:
# no auth.json/sessions/cache/npm). If docker/pi-agent/ is absent this layer