Move all hand-synced cross-app wire contracts into one built workspace package, @boocode/contracts, consumed by server/web/coder/coder-web via workspace:* + a per-subpath exports map. The ws-frames and provider-config Zod schemas are schema-first (z.infer); MessageMetadata, ErrorReason, AgentSessionConfig, the provider snapshot types, and WorktreeRiskReport are each single-sourced. Deletes the byte-identical copies and their parity tests, fixes a live AgentSessionConfig drift (coder dead copy removed, unified to the web required/nullable shape), removes the dead pending_change WS arms in the fallback SPA, and inverts the build order (contracts builds first) across root build, Dockerfile, and the coder deploy docs. Reverses the shared-package decision declined in v2.5.12. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.1 KiB
Docker
38 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
FROM node:20-alpine AS builder
|
|
RUN corepack enable
|
|
WORKDIR /build
|
|
|
|
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml tsconfig.base.json ./
|
|
COPY packages/contracts/package.json ./packages/contracts/
|
|
COPY apps/server/package.json ./apps/server/
|
|
COPY apps/web/package.json ./apps/web/
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# @boocode/contracts must be present before `pnpm build`, which builds it FIRST
|
|
# (root build script) so apps/web can resolve its compiled dist via the exports map.
|
|
COPY packages/contracts ./packages/contracts
|
|
COPY apps/server ./apps/server
|
|
COPY apps/web ./apps/web
|
|
|
|
RUN pnpm build
|
|
|
|
RUN pnpm deploy --filter=@boocode/server --prod --legacy /out/server
|
|
|
|
|
|
FROM node:20-alpine AS runtime
|
|
RUN apk add --no-cache ripgrep git openssh-client
|
|
RUN mkdir -p /root/.ssh && ssh-keyscan -p 2222 -H 100.114.205.53 git.indifferentketchup.com >> /root/.ssh/known_hosts && chmod 700 /root/.ssh && chmod 600 /root/.ssh/known_hosts
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /out/server ./
|
|
COPY --from=builder /build/apps/web/dist ./web
|
|
|
|
ENV NODE_ENV=production
|
|
ENV WEB_DIST_PATH=/app/web
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "dist/index.js"]
|