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.
23 lines
655 B
Docker
23 lines
655 B
Docker
FROM node:24-bookworm-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends bash ca-certificates git ripgrep python3 python-is-python3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --ignore-scripts
|
|
COPY tsconfig.json tsconfig.build.json ./
|
|
COPY src ./src
|
|
RUN npm run build && npm prune --omit=dev
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
ENV NODE_ENV=production \
|
|
WORKSPACE_DIR=/workspace \
|
|
PI_CODING_AGENT_DIR=/pi-agent
|
|
VOLUME ["/workspace", "/pi-agent"]
|
|
|
|
CMD ["/usr/local/bin/docker-entrypoint.sh"]
|