Files
stack/infra/images/docs.Dockerfile
kert 8bd649d9ab feat: skinny packages, tree reorg, cloud abstraction (refs #182–#201)
P23 — Skinny Packages:
- Break conf→bib circular dependency with lazy guarded import
- Extract aco.table.base → conf.table_base (shared foundation)
- Add try/except ImportError guards on all cross-module imports
- Define per-module optional-dependencies in pyproject.toml
- Slim base deps to just pydantic; all heavy deps in optional groups
- Add gen_config.py --check validation for module/dep sync
- Add skinny-install CI matrix job (tests each extra in isolation)

P24 — Tree Reorganization:
- Move service configs to infra/ (traefik, coredns, grafana, etc.)
- Consolidate Dockerfiles under infra/images/
- Move styles/ → assets/css/ + assets/icons/ + assets/nature.py
- Update compose.yml, stack.toml, gen_config.py, all backend emitters
- Update bootstrap scripts and install_certs.sh

P25 — Cloud Provider Abstraction:
- Add cloud/ directory with self-hosted, aws, gcp, azure stubs
- Add cloud contexts (aws, gcp, azure) to stack.toml
- Add conf/storage.py — get_filesystem() dispatches per context
- Add aws, gcp, azure optional dependency groups
- Document service mapping for each provider

All 11955 tests pass. Zero functionality lost.
2026-03-24 15:00:26 -04:00

56 lines
1.5 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
RUN corepack enable && corepack prepare pnpm@10.12.1 --activate
WORKDIR /docs
# Install dependencies (pnpm for deterministic, fast installs)
COPY docs/package.json docs/pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# 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 docs/docs/api/index.md docs/api/index.md
COPY --from=extract /build/docs/static/library.json static/library.json
RUN pnpm build
# Stage 3: Serve with nginx
# hadolint ignore=DL3006
FROM nginx:alpine
RUN apk upgrade --no-cache
COPY --from=build /docs/build /usr/share/nginx/html
COPY docs/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget -qO /dev/null http://localhost:80/ || exit 1