Files
bridge/Dockerfile
T
zeekay fbd08c4e1f rewrite(bridge): Next.js → Vite 8 SPA + hanzoai/spa
- Convert app/bridge/ from Next.js 14 app-router to Vite 8 SPA.
- New entry: index.html → src/main.tsx → src/App.tsx (wouter router).
- src/pages/{HomePage,AuthPage,CampaignsPage,CampaignDetailPage,SalonPage,
  SwapPage,TeleporterSwapPage,UtilaSwapPage,TransactionsPage,NotFoundPage}.tsx.
- src/shims/next-{link,image,navigation,dynamic,headers,server,font/google,mdx}
  + sentry-nextjs map Next.js APIs onto wouter + plain DOM so existing
  components compile unchanged. Aliased in vite.config.ts.
- Dockerfile (root + app/bridge): FROM node:22-alpine AS build → vite build →
  FROM ghcr.io/hanzoai/spa COPY dist /public.
- Delete app-router dir, next.config.js, next-env.d.ts, middleware.ts,
  sentry.*.ts. Keep app/explorer/ and docs/ untouched (still Next.js).

Tenant route resolution:
  src/app/api/tenant/route.ts was a 17-line edge handler that called
  lib/tenant.fetchTenant(). fetchTenant() only reads env vars and fetches a
  public IAM /api/get-organization endpoint. No secrets. Moved to client:
  lib/tenant.ts now reads import.meta.env.VITE_* and is called directly from
  main.tsx + TenantProvider. No sidecar needed.

TODO:
  - `pnpm install` in CI to pick up wouter, vite, @vitejs/plugin-react,
    @sentry/browser (added to package.json).
  - Pre-existing viem/teleport tsc errors remain (ignored as before via esbuild).
  - Storybook config still references @storybook/nextjs — rewire to
    @storybook/react-vite separately.
2026-04-19 00:05:10 -07:00

16 lines
415 B
Docker

# syntax=docker/dockerfile:1.7
#
# Bridge — Vite 8 SPA served by ghcr.io/hanzoai/spa.
# Build context: repo root (pnpm workspace).
FROM node:22-alpine AS build
RUN apk add --no-cache libc6-compat python3 make g++ git
RUN corepack enable
WORKDIR /app
COPY . .
RUN pnpm install --frozen-lockfile || pnpm install
RUN pnpm -C app/bridge build
FROM ghcr.io/hanzoai/spa
COPY --from=build /app/app/bridge/dist /public