#!/bin/sh # Containerized build for cyrion: mounts the Obsidian vault read-only and # writes dist/ into the repo checkout. Run from the repo root. set -eu VAULT="${VAULT:-/home/nox/docker/obsidian/vaults/weeslahw_coppermind}" # footer build stamp: the node container has no git, so resolve the # commit here ("+" = dirty tree, e.g. a local-state build after a failed pull) COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo '') if [ -n "$COMMIT" ] && ! git diff --quiet 2>/dev/null; then COMMIT="${COMMIT}+" fi # --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 \ --user "$(id -u):$(id -g)" \ -v "$(pwd):/app" \ -v "$VAULT:/content:ro" \ -e GARDEN_CONTENT=/content/Digital_Garden \ -e GARDEN_COMMIT="$COMMIT" \ -e ASTRO_TELEMETRY_DISABLED=1 \ -e HOME=/tmp \ -e npm_config_cache=/tmp/.npm \ -w /app \ node:24-slim \ sh -c "npm ci && npm run build"