mirror of
https://github.com/hanzoai/gallery.git
synced 2026-10-30 14:51:33 +00:00
One server, one version, one tag spelling. v0.5.1 is the only tag carrying 79ac4f9 (serve directory index in place), so stale pins served a DIFFERENT URL contract: docs.hanzo.ai still 301s /x/ -> /x/index.html while every v0.5.1 host does not. Also 0.5.1 (yadota) was never published as a tag, and the -amd64 suffix leaked an architecture (a place) into a version (a value).
26 lines
1.2 KiB
Docker
26 lines
1.2 KiB
Docker
# gallery.hanzo.ai — the Hanzo template gallery (72 real templates).
|
|
# Next.js static export (output: 'export') served by hanzoai/static — NOT nginx.
|
|
# Two stages: build the export, then re-serve it through the canonical static server.
|
|
|
|
# 1) Build the Next.js static export -> /app/out
|
|
# node:24 (LTS) has stable TypeScript type-stripping so the `prebuild` step can
|
|
# `import` app/templates-data.ts directly to emit public/templates.json (the SoT
|
|
# -> canonical catalog API). No flags needed.
|
|
FROM node:24-bookworm-slim AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --no-audit --no-fund
|
|
COPY . .
|
|
# next.config.ts sets output:'export'; produces /app/out. Turbopack build can be
|
|
# flaky in CI containers, so build with the stable webpack builder.
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
# 2) Serve the static export with hanzoai/static. --spa rewrites unknown routes
|
|
# to index.html (client routing); :3000 is the static default, and the
|
|
# gallery-site Service maps servicePort 80 -> targetPort 3000.
|
|
FROM ghcr.io/hanzoai/static:v0.5.1
|
|
COPY --from=build /app/out /srv
|
|
EXPOSE 3000
|
|
ENTRYPOINT ["/static", "--root=/srv", "--spa", "--port=3000"]
|