Files
stack/docs/Dockerfile
kert 9776915b50 add Docusaurus docs site with API reference and bibliography browser
Griffe-based docstring extraction (277 modules across 9 packages),
bib.Store export to searchable JSON (6560 items), throwback-themed
Docusaurus site served by nginx:alpine behind Traefik at
docs.homelab.fhirworx.io. Multi-stage Dockerfile, CI pipeline
steps, and dashboard tile included.
2026-02-28 23:08:47 -05:00

49 lines
1.2 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 (needs bib deps from src/)
COPY data/bib.sqlite data/bib.sqlite
COPY pyproject.toml .
RUN uv run 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* ./
RUN npm ci
# 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