mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
The server moved off /api/vN; the integration suite, handler tests, install.sh's health wait and the docs still called the old tree. Claude-Session: https://claude.ai/code/session_01TUxvfuta1Z44KVNYuAz71F
35 lines
1.6 KiB
Docker
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 /v1/o11y/*); this image serves
|
|
# the dashboard SPA at the edge, and the ingress routes o11y.hanzo.ai here while
|
|
# /v1/o11y/* goes to the backend.
|
|
#
|
|
# 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 /v1/o11y/*
|
|
# — 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"]
|