Files
o11y/Dockerfile.site
zeekay 1b5a3496ec chore(static): pin the ONE canonical hanzoai/static v0.5.1
v0.5.1 is the only tag carrying 79ac4f9 (serve directory index in place);
stale pins served a different URL contract. One server, one version, one spelling.
2026-07-25 10:42:39 -07:00

35 lines
1.6 KiB
Docker

# syntax=docker/dockerfile:1
#
# o11y-site — the o11y browser SPA served by hanzoai/static (house-native static
# plugin, scratch + Go binary), NOT nginx. The main server image (Dockerfile) is
# HEADLESS (O11Y_WEB_ENABLED=false, serves only /api/*); this image serves the
# dashboard SPA at the edge, and the ingress routes o11y.hanzo.ai here while
# /api/* goes to the backend (universe infra/k8s/o11y/ingress.yaml).
#
# CONTENT: built FROM SOURCE (frontend/) now that the @o11yhq -> @hanzo/ui
# migration is complete, tsgo --noEmit is clean, and `pnpm build` is green. The
# production build resolves the [[.BaseHref]]/[[.Settings]] Go-template placeholders
# at build time (vite.config.ts) so index.html is placeholder-free; assets are
# relative (base './') under <base href="/">, and the SPA calls same-origin /api/*
# — so a static --spa serve is faithful with no backend templating.
# 1) Build the SPA from source.
FROM node:22-slim AS build
# CI=true skips husky (postinstall is-ci guard); no interactive corepack prompt so
# the pnpm version pinned in package.json (packageManager) is fetched deterministically.
ENV CI=true
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN corepack enable
WORKDIR /src/frontend
COPY frontend/ ./
RUN pnpm install --frozen-lockfile
RUN pnpm build
# 2) Serve it with hanzoai/static. --spa rewrites unknown routes to index.html
# (client-side routing); :3000 is the static default, and the o11y-site
# Service maps servicePort 80 -> targetPort 3000.
FROM ghcr.io/hanzoai/static:v0.5.1
COPY --from=build /src/frontend/build /srv
EXPOSE 3000
ENTRYPOINT ["/static", "--root=/srv", "--spa", "--port=3000"]