feat: add Docker deployment with Containerfile, entrypoints, and nginx
Multi-stage Containerfile for all Node.js services (single image,
different CMD per docker-compose service). ESM entrypoints for gateway,
config, text-completion, prompt, embeddings, agent, and librarian.
Workbench gets a separate Containerfile (nginx:alpine) with SPA routing
and API/WebSocket proxy to gateway.
Docker Compose updated with 6 app services (gateway, config-service,
text-completion, prompt, embeddings, workbench) using shared
trustgraph-ts:local image.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 00:21:00 -05:00
|
|
|
# TrustGraph TypeScript — multi-stage build for all Node.js services.
|
|
|
|
|
# A single image is built once; each service overrides CMD to pick its entrypoint.
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
# Stage 1: Build
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
FROM node:22-slim AS builder
|
|
|
|
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy workspace config first for layer caching
|
2026-04-06 00:41:01 -05:00
|
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json tsconfig.base.json tsconfig.json ./
|
feat: add Docker deployment with Containerfile, entrypoints, and nginx
Multi-stage Containerfile for all Node.js services (single image,
different CMD per docker-compose service). ESM entrypoints for gateway,
config, text-completion, prompt, embeddings, agent, and librarian.
Workbench gets a separate Containerfile (nginx:alpine) with SPA routing
and API/WebSocket proxy to gateway.
Docker Compose updated with 6 app services (gateway, config-service,
text-completion, prompt, embeddings, workbench) using shared
trustgraph-ts:local image.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 00:21:00 -05:00
|
|
|
COPY packages/base/package.json packages/base/tsconfig.json packages/base/
|
|
|
|
|
COPY packages/client/package.json packages/client/tsconfig.json packages/client/
|
|
|
|
|
COPY packages/flow/package.json packages/flow/tsconfig.json packages/flow/
|
|
|
|
|
COPY packages/cli/package.json packages/cli/tsconfig.json packages/cli/
|
|
|
|
|
COPY packages/mcp/package.json packages/mcp/tsconfig.json packages/mcp/
|
2026-04-06 00:41:01 -05:00
|
|
|
COPY packages/workbench/package.json packages/workbench/tsconfig.json packages/workbench/
|
feat: add Docker deployment with Containerfile, entrypoints, and nginx
Multi-stage Containerfile for all Node.js services (single image,
different CMD per docker-compose service). ESM entrypoints for gateway,
config, text-completion, prompt, embeddings, agent, and librarian.
Workbench gets a separate Containerfile (nginx:alpine) with SPA routing
and API/WebSocket proxy to gateway.
Docker Compose updated with 6 app services (gateway, config-service,
text-completion, prompt, embeddings, workbench) using shared
trustgraph-ts:local image.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 00:21:00 -05:00
|
|
|
|
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
# Copy source and build
|
|
|
|
|
COPY packages/ packages/
|
|
|
|
|
RUN pnpm build
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
# Stage 2: Runtime
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
FROM node:22-slim AS runtime
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy built output and production deps
|
|
|
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
|
COPY --from=builder /app/packages ./packages
|
|
|
|
|
COPY --from=builder /app/package.json ./
|
|
|
|
|
COPY --from=builder /app/pnpm-workspace.yaml ./
|
|
|
|
|
COPY entrypoints/ ./entrypoints/
|
|
|
|
|
|
|
|
|
|
# Default env
|
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
ENV NATS_URL=nats://nats:4222
|
|
|
|
|
|
|
|
|
|
EXPOSE 8088
|
|
|
|
|
CMD ["node", "entrypoints/gateway.mjs"]
|