Files
stack/docs/Dockerfile
kert 49100bcb22
Some checks failed
ci/woodpecker/push/infra-ci Pipeline failed
ci/woodpecker/pr/infra-ci Pipeline failed
ci/woodpecker/push/ci Pipeline was successful
coverage 99% coverage
ci/woodpecker/pr/ci Pipeline was successful
docs search: local plugin, enriched library, tests, UX
## Full-text search for docs (#63)
Install @easyops-cn/docusaurus-search-local — client-side Lunr
search that indexes all 450+ doc pages at build time.

## Fix broken /api link (#65)
Create docs/docs/api/index.md, fix intro.md, onBrokenLinks=throw.

## Enriched library data (#64, #66)
Full abstracts, creators/authors, Dockerfile pydantic fix.

## Library search UX (#68)
200ms debounce, URL state, Cmd+K shortcut.

## Integration tests (#67)
9 new tests: export, fields, truncation, tags, links, API docs.

fix #63, fix #64, fix #65, fix #66, fix #67, fix #68
2026-03-21 15:32:08 -04:00

49 lines
1.3 KiB
Docker

# Stage 1: Extract docs from Python source + export bib library
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS extract
WORKDIR /build
# Copy source code and extraction scripts
COPY src/ src/
COPY docs/scripts/ docs/scripts/
# Extract API docs via griffe (pure AST, no imports)
RUN uv run --with griffe python docs/scripts/extract_docs.py
# Export bibliography (gracefully handles missing bib.sqlite)
COPY data/bib.sqlit[e] data/
RUN uv run --with pydantic python docs/scripts/export_library.py
# Stage 2: Build Docusaurus static site
FROM node:22-slim AS build
WORKDIR /docs
# Install dependencies
COPY docs/package.json docs/package-lock.json* ./
# hadolint ignore=DL3016
RUN npm install
# Copy Docusaurus config and source
COPY docs/docusaurus.config.js docs/sidebars.js docs/babel.config.js docs/tsconfig.json ./
COPY docs/src/ src/
COPY docs/static/ static/
COPY docs/docs/ docs/
# Copy generated API docs and library.json from extract stage
COPY --from=extract /build/docs/docs/api/ docs/api/
COPY --from=extract /build/docs/static/library.json static/library.json
RUN npm run build
# Stage 3: Serve with nginx
# hadolint ignore=DL3006
FROM nginx:alpine
COPY --from=build /docs/build /usr/share/nginx/html
COPY docs/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80