feat: distribution layer — SDK, React, migrations, deploy infra (no CI/CD)
- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource
client per /v1 resource (products, checkout, payments, entitlements,
licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…),
AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping.
- @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits
hooks, <Paywall> + <UpgradeButton> (React 18, plan §4).
- database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables,
indexes, FKs) + db:generate/migrate/push/studio scripts.
- infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore,
docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile.
No tests. No CI/CD pipelines.
2026-06-15 11:02:39 +03:00
# syntax=docker/dockerfile:1
# Multi-stage build for the SettleKit API (@settlekit/api).
# Build context is the monorepo root: `docker build -f apps/api/Dockerfile .`
chore(deploy): Colosseum Render blueprint for api, worker, checkout, dashboard and web
- render.yaml deploys the five buyer/seller services on Node 22 with every
env var the new surfaces read (chains, routing, HyperCore, Zcash, x402/MPP,
onchain billing, service token, Discord, fee); Node builds install only the
app and its workspace deps (pnpm --filter <app>...). Free plans everywhere
except the worker (Render has no free background workers: starter).
- API/worker Dockerfiles install filtered; the API runs migrations on boot
because preDeployCommand is paid-only.
- worker boots without GitHub App / Resend / Discord credentials: those
deliveries stay pending and emails are skipped with a warning.
- .env.example documents the service token, manage-link secret and Discord OAuth.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:43:12 +03:00
# ---- Base: Node 22 + pnpm via Corepack -------------------------------------
2026-09-29 19:20:13 +03:00
FROM node:22-alpine AS base
feat: distribution layer — SDK, React, migrations, deploy infra (no CI/CD)
- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource
client per /v1 resource (products, checkout, payments, entitlements,
licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…),
AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping.
- @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits
hooks, <Paywall> + <UpgradeButton> (React 18, plan §4).
- database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables,
indexes, FKs) + db:generate/migrate/push/studio scripts.
- infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore,
docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile.
No tests. No CI/CD pipelines.
2026-06-15 11:02:39 +03:00
ENV PNPM_HOME = /pnpm
ENV PATH = $PNPM_HOME :$PATH
2026-09-30 19:36:07 +03:00
# Non-interactive build: lets the prod-deps `pnpm install --prod` purge the
# modules dir without a TTY prompt (ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY).
ENV CI = true
feat: distribution layer — SDK, React, migrations, deploy infra (no CI/CD)
- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource
client per /v1 resource (products, checkout, payments, entitlements,
licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…),
AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping.
- @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits
hooks, <Paywall> + <UpgradeButton> (React 18, plan §4).
- database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables,
indexes, FKs) + db:generate/migrate/push/studio scripts.
- infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore,
docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile.
No tests. No CI/CD pipelines.
2026-06-15 11:02:39 +03:00
RUN corepack enable
WORKDIR /app
chore(deploy): Colosseum Render blueprint for api, worker, checkout, dashboard and web
- render.yaml deploys the five buyer/seller services on Node 22 with every
env var the new surfaces read (chains, routing, HyperCore, Zcash, x402/MPP,
onchain billing, service token, Discord, fee); Node builds install only the
app and its workspace deps (pnpm --filter <app>...). Free plans everywhere
except the worker (Render has no free background workers: starter).
- API/worker Dockerfiles install filtered; the API runs migrations on boot
because preDeployCommand is paid-only.
- worker boots without GitHub App / Resend / Discord credentials: those
deliveries stay pending and emails are skipped with a warning.
- .env.example documents the service token, manage-link secret and Discord OAuth.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:43:12 +03:00
# ---- Dependencies: install only the api and its workspace deps (frozen) ----
feat: distribution layer — SDK, React, migrations, deploy infra (no CI/CD)
- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource
client per /v1 resource (products, checkout, payments, entitlements,
licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…),
AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping.
- @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits
hooks, <Paywall> + <UpgradeButton> (React 18, plan §4).
- database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables,
indexes, FKs) + db:generate/migrate/push/studio scripts.
- infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore,
docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile.
No tests. No CI/CD pipelines.
2026-06-15 11:02:39 +03:00
FROM base AS deps
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml tsconfig.base.json ./
COPY packages ./packages
COPY apps ./apps
chore(deploy): Colosseum Render blueprint for api, worker, checkout, dashboard and web
- render.yaml deploys the five buyer/seller services on Node 22 with every
env var the new surfaces read (chains, routing, HyperCore, Zcash, x402/MPP,
onchain billing, service token, Discord, fee); Node builds install only the
app and its workspace deps (pnpm --filter <app>...). Free plans everywhere
except the worker (Render has no free background workers: starter).
- API/worker Dockerfiles install filtered; the API runs migrations on boot
because preDeployCommand is paid-only.
- worker boots without GitHub App / Resend / Discord credentials: those
deliveries stay pending and emails are skipped with a warning.
- .env.example documents the service token, manage-link secret and Discord OAuth.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:43:12 +03:00
RUN pnpm install --frozen-lockfile --filter settlekit --filter "@settlekit/api..."
feat: distribution layer — SDK, React, migrations, deploy infra (no CI/CD)
- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource
client per /v1 resource (products, checkout, payments, entitlements,
licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…),
AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping.
- @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits
hooks, <Paywall> + <UpgradeButton> (React 18, plan §4).
- database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables,
indexes, FKs) + db:generate/migrate/push/studio scripts.
- infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore,
docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile.
No tests. No CI/CD pipelines.
2026-06-15 11:02:39 +03:00
# ---- Build: compile package deps + the api via tsc project references ------
FROM deps AS build
# `tsc -b` on the api walks its referenced packages and builds them in order.
RUN pnpm --filter @settlekit/api... build
# ---- Production deps: prune dev dependencies -------------------------------
FROM build AS prod-deps
RUN pnpm --filter @settlekit/api... install --prod --frozen-lockfile
# ---- Runtime: ship dist + production node_modules --------------------------
FROM base AS runtime
ENV NODE_ENV = production
ENV PORT = 8787
WORKDIR /app
# Workspace metadata so pnpm can resolve the workspace symlinks at runtime.
COPY --from= build /app/package.json /app/pnpm-workspace.yaml ./
COPY --from= prod-deps /app/node_modules ./node_modules
# Built output + production deps for every package the api depends on.
COPY --from= build /app/packages ./packages
COPY --from= prod-deps /app/packages ./packages
COPY --from= build /app/apps/api/dist ./apps/api/dist
COPY --from= build /app/apps/api/package.json ./apps/api/package.json
COPY --from= prod-deps /app/apps/api/node_modules ./apps/api/node_modules
WORKDIR /app/apps/api
EXPOSE 8787
chore(deploy): Colosseum Render blueprint for api, worker, checkout, dashboard and web
- render.yaml deploys the five buyer/seller services on Node 22 with every
env var the new surfaces read (chains, routing, HyperCore, Zcash, x402/MPP,
onchain billing, service token, Discord, fee); Node builds install only the
app and its workspace deps (pnpm --filter <app>...). Free plans everywhere
except the worker (Render has no free background workers: starter).
- API/worker Dockerfiles install filtered; the API runs migrations on boot
because preDeployCommand is paid-only.
- worker boots without GitHub App / Resend / Discord credentials: those
deliveries stay pending and emails are skipped with a warning.
- .env.example documents the service token, manage-link secret and Discord OAuth.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:43:12 +03:00
# Apply pending migrations (idempotent), then serve. Render's preDeployCommand
# is paid-plan only, so the free API migrates on boot.
2026-11-10 17:16:08 +03:00
#
# The migration step is `||`, not `&&`: found 2026-11-10 that a stale/
# unreachable DATABASE_URL made migration hang (now bounded by
# packages/database's DEFAULT_CONNECT_TIMEOUT_SECONDS) and, with the old
# `&&` chain, a migration failure meant the server was never even attempted
# — one bad DB env var took down the whole container, including endpoints
# that don't need the database. Now the server always starts and reports
# its own real DB-connectivity error (fast, bounded, visible in logs)
# instead of the whole boot silently never finishing.
CMD [ "sh" , "-c" , "if [ -n \"$DATABASE_URL\" ] ; then node /app/packages/database/dist/cli.js || echo '[migrate] failed or timed out — starting the server anyway so non-DB endpoints still serve' ; fi ; exec node dist/server.js" ]