Starlight, diataxis-shaped: a tutorial pair, six how-to guides, a generated tool reference plus a configuration reference, and four explanation pages covering architecture, sandbox isolation, see-and-drive, and the failure handling philosophy. The tool reference is generated from the running MCP server's own schemas, so its 33 tools, parameters and defaults cannot drift from the code; the generator asserts its grouping still covers exactly the live tool set. Infrastructure follows the warehacking cookie-cutter (multi-stage Dockerfile, Caddy serving dist with real 404 status, compose profiles for prod and dev, Makefile with a deploy target pointed at docker-2). Two deviations worth noting: remark-gfm is added to the MDX pipeline because Astro enables GFM for .md but not .mdx, so tables silently rendered as run-together paragraphs; and the card icon palette is pinned to the accent because Starlight's staggered grid rotates through colours including purple. Package URLs now point at the Gitea repo and this site.
48 lines
1.5 KiB
Docker
48 lines
1.5 KiB
Docker
# Multi-stage build for the mcqemu docs site.
|
|
#
|
|
# Stages:
|
|
# - base : Node, pnpm/npm tooling, deps installed
|
|
# - dev : runs `astro dev` with HMR for local development
|
|
# - builder : produces the static `dist/`
|
|
# - prod : caddy:alpine that serves `dist/` (no Node at runtime)
|
|
#
|
|
# `docker compose --profile dev up` → dev target
|
|
# `docker compose up` (no profile) → prod target
|
|
|
|
# Pinned through the mirror.gcr.io pass-through to dodge intermittent
|
|
# Docker Hub TLS hiccups during builds. Same content, more reliable
|
|
# fetch path. The `docker pull` resolves identically against either.
|
|
FROM mirror.gcr.io/library/node:22-alpine AS base
|
|
WORKDIR /app
|
|
COPY package.json ./
|
|
RUN --mount=type=cache,target=/root/.npm \
|
|
npm install --no-audit --no-fund
|
|
|
|
|
|
# ----- dev: astro dev server with HMR -----
|
|
FROM base AS dev
|
|
# Astro's binary is in node_modules/.bin — package.json's `dev` script
|
|
# already binds to 0.0.0.0 for HMR-behind-Caddy.
|
|
COPY . .
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
EXPOSE 4321
|
|
CMD ["npm", "run", "dev"]
|
|
|
|
|
|
# ----- builder: produce dist/ -----
|
|
FROM base AS builder
|
|
COPY . .
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
|
|
# ----- prod: caddy serves the static build -----
|
|
FROM mirror.gcr.io/library/caddy:2-alpine AS prod
|
|
# Caddyfile is intentionally minimal — caddy-docker-proxy on the host
|
|
# handles TLS, routing, and the public-facing reverse proxy. This
|
|
# container just serves files locally; the proxy points at it.
|
|
RUN mkdir -p /srv/docs
|
|
COPY --from=builder /app/dist /srv/docs
|
|
COPY Caddyfile /etc/caddy/Caddyfile
|
|
EXPOSE 80
|