This commit is contained in:
elpresidank 2026-05-12 08:06:58 -05:00
parent e8c7a4f6e0
commit ffd97375a8
160 changed files with 6704 additions and 1895 deletions

View file

@ -1,15 +1,14 @@
# TrustGraph TypeScript — multi-stage build for all Node.js services.
# TrustGraph TypeScript — multi-stage build for all Bun 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
FROM oven/bun:1.3.13-slim AS builder
WORKDIR /app
# Copy workspace config first for layer caching
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json tsconfig.base.json tsconfig.json ./
COPY package.json bun.lock pnpm-workspace.yaml turbo.json tsconfig.base.json tsconfig.json ./
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/
@ -17,16 +16,16 @@ COPY packages/cli/package.json packages/cli/tsconfig.json packages/cli/
COPY packages/mcp/package.json packages/mcp/tsconfig.json packages/mcp/
COPY packages/workbench/package.json packages/workbench/tsconfig.json packages/workbench/
RUN pnpm install --frozen-lockfile
RUN bun install --frozen-lockfile
# Copy source and build
COPY packages/ packages/
RUN pnpm build --filter=@trustgraph/base --filter=@trustgraph/client --filter=@trustgraph/flow
RUN bunx --bun turbo build --filter=@trustgraph/base --filter=@trustgraph/client --filter=@trustgraph/flow
# ---------------------------------------------------------------------------
# Stage 2: Runtime
# ---------------------------------------------------------------------------
FROM node:22-slim AS runtime
FROM oven/bun:1.3.13-slim AS runtime
WORKDIR /app
# Copy built output and production deps
@ -41,4 +40,4 @@ ENV NODE_ENV=production
ENV NATS_URL=nats://nats:4222
EXPOSE 8088
CMD ["node", "entrypoints/gateway.mjs"]
CMD ["bun", "entrypoints/gateway.mjs"]