mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
03bed3b76b
Lockfiles committed in 8ba692c42 were generated inside the monorepo
while pnpm's hoisted node_modules tree was present. npm-arborist
resolved transitive deps against pnpm's symlinks and wrote ~40
`../../../node_modules/.pnpm/...` paths into each lockfile's
`packages` map.
npm 10 can parse the JSON, but its arborist bombs out walking the
tree at those pnpm-relative entries with the misleading error:
npm error code EUSAGE
npm error The `npm ci` command can only install with an
npm error existing package-lock.json or npm-shrinkwrap.json
npm error with lockfileVersion >= 1.
`npm install --dry-run` surfaces the real cause:
Cannot read properties of undefined (reading 'extraneous')
A fresh lockfile generated in an isolated container works.
- broken: 1259 packages, 43 with `../../../node_modules/.pnpm/...`
- fresh: 1321 packages, all `node_modules/...` paths
This commit regenerates every integration's lockfile inside an
isolated `node:22-slim` container via `npm install
--package-lock-only --legacy-peer-deps` and verifies with `npm ci`.
44 lines
1.4 KiB
Docker
44 lines
1.4 KiB
Docker
# Single-stage Dockerfile for the built-in-agent showcase package.
|
|
# Unlike sibling showcase packages (which run a separate agent server
|
|
# process and need a multi-stage build), built-in-agent runs its
|
|
# BuiltInAgent in-process inside the Next.js route handler. One Node
|
|
# image, one process, one port.
|
|
|
|
# Stage 1: Build Next.js
|
|
FROM node:22-slim AS builder
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --legacy-peer-deps
|
|
COPY . .
|
|
RUN npx next build
|
|
|
|
# Stage 2: Runtime
|
|
FROM node:22-slim AS runner
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN (groupadd --system --gid 1001 app 2>/dev/null || true) \
|
|
&& (useradd --system --uid 1001 --gid 1001 --no-create-home app 2>/dev/null || true) \
|
|
&& mkdir -p /home/app && chown app:app /home/app
|
|
|
|
COPY --chown=app:app --from=builder /app/.next ./.next
|
|
COPY --chown=app:app --from=builder /app/node_modules ./node_modules
|
|
COPY --chown=app:app --from=builder /app/package.json ./
|
|
COPY --chown=app:app --from=builder /app/public ./public
|
|
|
|
COPY --chown=app:app entrypoint.sh ./
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
# Ensure WORKDIR itself is owned by `app` — `WORKDIR /app` at the top of
|
|
# the stage creates /app as root. Without this, any CLI that tries to
|
|
# mkdir under /app at runtime hits EACCES.
|
|
RUN chown app:app /app
|
|
USER app
|
|
|
|
EXPOSE 10000
|
|
ENV PORT=10000
|
|
ENV HOSTNAME=0.0.0.0
|
|
CMD ["./entrypoint.sh"]
|