mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
36020b061f
Two clonable starter templates showing CopilotKit driving a Claude Agent SDK agent over AG-UI, mirroring the langgraph-python showcase (todos canvas, charts, flight cards, dynamic dashboards, HITL, theme, threads drawer). Each agent is a thin, idiomatic layer on the official ag-ui-claude-sdk / @ag-ui/claude-agent-sdk adapters: three backend tools (query_data, search_flights, generate_a2ui) live in per-tool modules and are wired into ClaudeAgentAdapter, while the shared todo board is driven by the adapter's built-in ag_ui_update_state tool. The default model is claude-sonnet-5 and local dev uses a real ANTHROPIC_API_KEY (matching the official AG-UI dojo). Both instances are registered in the _parity manifest so their frontends stay synced with the langgraph-python north-star. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
58 lines
1.9 KiB
Docker
58 lines
1.9 KiB
Docker
# Stage 1: Build Next.js frontend
|
|
FROM node:22-slim AS frontend
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json ./
|
|
RUN npm install --ignore-scripts
|
|
|
|
# Fix CVE: Railway scans package.json, so we update it too
|
|
RUN npm install next@latest && \
|
|
node -e "const p=require('./package.json'); p.dependencies.next='^16'; require('fs').writeFileSync('package.json',JSON.stringify(p,null,2))"
|
|
|
|
COPY src/ ./src/
|
|
COPY public/ ./public/
|
|
COPY next.config.ts tsconfig.json postcss.config.mjs ./
|
|
COPY showcase.json ./showcase.json
|
|
|
|
# Patch next.config.ts to ignore TS errors during build (can't modify original source)
|
|
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n};'); fs.writeFileSync(f,c);}"
|
|
|
|
RUN npm run build
|
|
|
|
# Stage 2: Production image with Python + Node
|
|
FROM python:3.12-slim AS runner
|
|
|
|
# Install Node.js 20 + uv
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends curl ca-certificates && \
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
apt-get install -y --no-install-recommends nodejs && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install uv by copying from the official image (avoids curl|sh pipe-swallow bug
|
|
# where a 5xx on astral.sh silently produces an exit-0 layer with no uv binary).
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies from lockfile
|
|
COPY agent/ ./agent/
|
|
RUN cd agent && uv sync --frozen
|
|
|
|
# Copy Next.js build output and production node_modules
|
|
COPY --from=frontend /app/.next ./.next
|
|
COPY --from=frontend /app/node_modules ./node_modules
|
|
COPY --from=frontend /app/package.json ./
|
|
COPY --from=frontend /app/public ./public
|
|
|
|
# Copy entrypoint
|
|
COPY entrypoint.sh ./
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
EXPOSE 3000
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
CMD ["./entrypoint.sh"]
|