build.sh: run the build container as the invoking user

Root-owned node_modules/dist/public from the container blocked git pull
(public/fonts could not be created). Chown once, then keep artifacts
user-owned via --user + HOME/npm cache in /tmp.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wes
2026-07-21 21:41:32 -04:00
co-authored by Claude Fable 5
parent bb80d1836a
commit 8efb1ecf80
+5
View File
@@ -5,11 +5,16 @@ set -eu
VAULT="${VAULT:-/home/nox/docker/obsidian/vaults/weeslahw_coppermind}" VAULT="${VAULT:-/home/nox/docker/obsidian/vaults/weeslahw_coppermind}"
# --user: build artifacts (node_modules, dist, public/assets) must stay
# owned by the invoking user, or the next git pull can't write the tree
docker run --rm \ docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$(pwd):/app" \ -v "$(pwd):/app" \
-v "$VAULT:/content:ro" \ -v "$VAULT:/content:ro" \
-e GARDEN_CONTENT=/content/Digital_Garden \ -e GARDEN_CONTENT=/content/Digital_Garden \
-e ASTRO_TELEMETRY_DISABLED=1 \ -e ASTRO_TELEMETRY_DISABLED=1 \
-e HOME=/tmp \
-e npm_config_cache=/tmp/.npm \
-w /app \ -w /app \
node:24-slim \ node:24-slim \
sh -c "npm ci && npm run build" sh -c "npm ci && npm run build"