Files
VolcanicSecretary/docker-entrypoint.sh
EugeneTes 8c6b4c1a54 Install pi-claude-code-provider on first container start
The Pi coding agent stores installed packages under $PI_CODING_AGENT_DIR
(=/pi-agent in the image), which is a volume — so anything installed at
build time is masked at runtime. Wrap the CMD in an entrypoint that runs
`pi install npm:pi-claude-code-provider` the first time the volume is
seen and drops a marker so subsequent starts are a no-op.
2026-09-06 17:21:03 +00:00

20 lines
497 B
Bash

#!/bin/sh
set -e
PI_DIR="${PI_CODING_AGENT_DIR:-/pi-agent}"
MARKER="$PI_DIR/.pi-claude-code-provider.installed"
if [ ! -f "$MARKER" ]; then
echo "[entrypoint] pi install npm:pi-claude-code-provider"
mkdir -p "$PI_DIR"
if /app/node_modules/.bin/pi install npm:pi-claude-code-provider; then
touch "$MARKER"
else
echo "[entrypoint] pi install failed; will retry on next start" >&2
fi
else
echo "[entrypoint] pi-claude-code-provider already installed"
fi
exec node dist/main.js