fix(pi): isolate resolved package builds

This commit is contained in:
2026-08-16 00:20:30 +02:00
parent 5a657a67e8
commit 3e0c864c85
6 changed files with 96 additions and 5 deletions
+7 -1
View File
@@ -10,9 +10,15 @@ FROM node:22-bookworm@sha256:7725a5c2c83eed1d36258c66efae14b1ceccd021db9ed1d9559
# ---- Stage 0: locked Pi runtime ----
FROM node:22-bookworm@sha256:7725a5c2c83eed1d36258c66efae14b1ceccd021db9ed1d9559d3335ed3d68ed AS pi-runtime-build
ARG PI_VERSION
ARG PI_RUNTIME_PACKAGE_VERSION
ARG PI_PACKAGE_NAME=@earendil-works/pi-coding-agent
WORKDIR /opt/pi-runtime
COPY docker/pi-runtime/package.json docker/pi-runtime/package-lock.json ./
RUN npm ci --omit=dev \
RUN if [ -n "$PI_RUNTIME_PACKAGE_VERSION" ]; then \
node -e 'const fs=require("node:fs"); const [name,version]=process.argv.slice(1); const manifest=JSON.parse(fs.readFileSync("package.json","utf8")); manifest.dependencies[name]=version; fs.writeFileSync("package.json",JSON.stringify(manifest,null,2)+"\\n");' "$PI_PACKAGE_NAME" "$PI_RUNTIME_PACKAGE_VERSION"; \
npm install --package-lock-only --ignore-scripts --omit=dev "$PI_PACKAGE_NAME@$PI_RUNTIME_PACKAGE_VERSION"; \
fi \
&& npm ci --omit=dev \
&& test "$(./node_modules/.bin/pi --version)" = "$PI_VERSION"
# ---- Stage 1: backend TypeScript -> dist ----