FROM node:22-bookworm-slim ARG PI_VERSION=0.84.2 RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl git openssh-client ripgrep \ && rm -rf /var/lib/apt/lists/* WORKDIR /opt/chat-ui-agent COPY patch-pi-rpc.mjs /opt/chat-ui-agent/ RUN npm init -y \ && npm install --omit=dev --no-audit --no-fund \ "@earendil-works/pi-coding-agent@${PI_VERSION}" \ "ws@8.21.3" \ && node /opt/chat-ui-agent/patch-pi-rpc.mjs \ /opt/chat-ui-agent/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js \ && ln -s /opt/chat-ui-agent/node_modules/.bin/pi /usr/local/bin/pi COPY bridge.mjs bridge-turn-fence.mjs runtime-health.mjs approval-gate.mjs approval-policy.mjs pi-args.mjs /opt/chat-ui-agent/ ENV PI_TELEMETRY=0 EXPOSE 7860 CMD ["node", "/opt/chat-ui-agent/runtime-health.mjs"]