Files
id/Dockerfile
z 8d2ad1891a chore(spa): pin the ONE canonical hanzoai/spa 1.4.8
hanzoai/spa is the SPA-friendly server (index.html/.html fallthrough + a CSP
that does not blank a client-routed app); hanzoai/static is the strict one.
Consumers had drifted to two untagged pins (implicit :latest — banned, and
non-reproducible) and three at 1.2.0, thirteen patches behind. One image,
one version. Published spelling is 1.4.8 (v1.4.8 does not exist).
2026-07-25 10:46:58 -07:00

30 lines
1.2 KiB
Docker

# syntax=docker/dockerfile:1.7
# Hanzo ID — Vite SPA built once, served by hanzoai/spa.
FROM node:24-alpine AS build
WORKDIR /build
ENV PNPM_HOME=/pnpm PATH=$PNPM_HOME:$PATH
RUN corepack enable && corepack prepare pnpm@10.15.0 --activate
COPY pnpm-workspace.yaml package.json tsconfig.base.json ./
COPY apps/web/package.json apps/web/
COPY pkgs/shared/package.json pkgs/shared/
COPY pkgs/auth/package.json pkgs/auth/
COPY pkgs/connect/package.json pkgs/connect/
COPY pkgs/idv/package.json pkgs/idv/
COPY pkgs/onboarding/package.json pkgs/onboarding/
RUN pnpm install --frozen-lockfile=false
COPY apps apps
COPY pkgs pkgs
RUN pnpm --filter @hanzo/id-web build
# SPA server stage — hanzoai/spa is the correct base for a Vite SPA:
# history-API fallthrough for client-side routes AND a SPA-safe CSP.
# hanzoai/static defaults to `Content-Security-Policy: default-src 'none'`
# (built for static assets, not an app that loads its own bundle), which
# blocks the SPA's own scripts and leaves a blank page. hanzoai/spa serves
# index.html for all routes with a sane CSP. Defaults: PORT=3000, ROOT=/public.
FROM ghcr.io/hanzoai/spa:1.4.8
COPY --from=build /build/apps/web/dist /public
EXPOSE 3000