mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
b7fae67f01
Implements plan-B B11. URL and analytics NEXT_PUBLIC_* values now reach each shell at runtime via Option B (env-driven runtime-config), so the GHA showcase_build.yml workflow no longer threads them through as Docker build-args and the shell-dashboard/shell-docs Dockerfiles no longer declare the matching ARG/ENV pairs. - showcase_build.yml: shell-dashboard and shell-docs matrix entries lose build_args_pb_url / build_args_shell_url / build_args_ops_url / build_args_base_url / build_args_analytics; the 'Prepare build args' step drops the corresponding env: keys and if-branches plus the five analytics NEXT_PUBLIC_* secrets. COMMIT_SHA and BRANCH stay — they identify the artifact. - showcase/shell-dashboard/Dockerfile: remove ARG/ENV for NEXT_PUBLIC_SHELL_URL, NEXT_PUBLIC_POCKETBASE_URL, OPS_BASE_URL plus the explanatory comments. Update the runner-stage comment to point at runtime-config.ts as the new source of truth. - showcase/shell-docs/Dockerfile: remove ARG/ENV for NEXT_PUBLIC_BASE_URL, NEXT_PUBLIC_SHELL_URL, NEXT_PUBLIC_POSTHOG_KEY, NEXT_PUBLIC_REB2B_KEY, NEXT_PUBLIC_SCARF_PIXEL_ID, NEXT_PUBLIC_REO_KEY, NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID. COMMIT_SHA / BRANCH retained. shell/Dockerfile and shell-dojo/Dockerfile already only declare commit-sha and branch ARGs — no changes needed there (per plan-B B11.4).
49 lines
1.7 KiB
Docker
49 lines
1.7 KiB
Docker
FROM node:20-slim AS builder
|
|
ARG COMMIT_SHA=unknown
|
|
ARG BRANCH=unknown
|
|
WORKDIR /app
|
|
|
|
# Copy only what shell-docs + scripts need
|
|
COPY showcase/scripts/package.json ./scripts/package.json
|
|
COPY showcase/scripts/package-lock.json ./scripts/package-lock.json
|
|
COPY showcase/shell-docs/package.json ./shell-docs/package.json
|
|
COPY showcase/shell-docs/package-lock.json ./shell-docs/package-lock.json
|
|
|
|
# Install deps for both (standalone, no workspace)
|
|
RUN cd scripts && npm ci --silent && cd ../shell-docs && npm ci --silent
|
|
|
|
# Copy source
|
|
COPY showcase/shared/ ./shared/
|
|
COPY showcase/integrations/ ./integrations/
|
|
COPY showcase/scripts/ ./scripts/
|
|
COPY showcase/shell-docs/ ./shell-docs/
|
|
|
|
# Bake commit info into Next.js build
|
|
ENV NEXT_PUBLIC_COMMIT_SHA=${COMMIT_SHA}
|
|
ENV NEXT_PUBLIC_BRANCH=${BRANCH}
|
|
|
|
# Generate registry + content, then build Next.js
|
|
RUN cd scripts && node node_modules/tsx/dist/cli.mjs generate-registry.ts \
|
|
&& node node_modules/tsx/dist/cli.mjs bundle-demo-content.ts \
|
|
&& node node_modules/tsx/dist/cli.mjs bundle-setup-content.ts \
|
|
&& node node_modules/tsx/dist/cli.mjs generate-search-index.ts \
|
|
&& cd ../shell-docs && npx next build
|
|
|
|
FROM node:20-slim AS runner
|
|
WORKDIR /app
|
|
ARG COMMIT_SHA=unknown
|
|
ARG BRANCH=unknown
|
|
ENV NODE_ENV=production
|
|
ENV PORT=10000
|
|
ENV NEXT_PUBLIC_COMMIT_SHA=${COMMIT_SHA}
|
|
ENV NEXT_PUBLIC_BRANCH=${BRANCH}
|
|
|
|
COPY --from=builder /app/shell-docs/.next ./.next
|
|
COPY --from=builder /app/shell-docs/node_modules ./node_modules
|
|
COPY --from=builder /app/shell-docs/package.json ./
|
|
COPY --from=builder /app/shell-docs/public ./public
|
|
COPY --from=builder /app/shell-docs/src/content ./src/content
|
|
|
|
EXPOSE 10000
|
|
CMD ["npx", "next", "start", "-p", "10000"]
|