Fix library.json empty in Docker builds — pydantic dep in Dockerfile #64

Closed
opened 2026-03-21 19:27:38 +00:00 by kert · 0 comments
Owner

Problem

The Dockerfile extract stage runs export_library.py which imports bib.store → bib.item → pydantic. But pydantic isn't installed in the extract stage, so the import fails silently and writes empty JSON.

Already fixed locally with uv run --with pydantic, but need to verify the fix persists and add a build-time assertion.

Fix

  1. Verify docs/Dockerfile line 15 uses uv run --with pydantic python docs/scripts/export_library.py
  2. Add a build-time check: after export, verify library.json has >0 items
  3. Add nginx.conf cache headers for JSON: no-cache, must-revalidate

Also

  • Remove abstract truncation (300 chars) — full abstracts improve search quality
  • Export creators/authors into library.json for richer search

Files

  • docs/Dockerfile
  • docs/scripts/export_library.py
  • docs/nginx.conf
## Problem The Dockerfile extract stage runs `export_library.py` which imports `bib.store` → `bib.item` → `pydantic`. But pydantic isn't installed in the extract stage, so the import fails silently and writes empty JSON. Already fixed locally with `uv run --with pydantic`, but need to verify the fix persists and add a build-time assertion. ## Fix 1. Verify `docs/Dockerfile` line 15 uses `uv run --with pydantic python docs/scripts/export_library.py` 2. Add a build-time check: after export, verify library.json has >0 items 3. Add `nginx.conf` cache headers for JSON: `no-cache, must-revalidate` ## Also - Remove abstract truncation (300 chars) — full abstracts improve search quality - Export creators/authors into library.json for richer search ## Files - `docs/Dockerfile` - `docs/scripts/export_library.py` - `docs/nginx.conf`
kert added this to the P13: Docs Search — local search, library data, broken links, tests milestone 2026-03-21 19:27:38 +00:00
kert added the docs label 2026-03-21 19:27:38 +00:00
kert closed this issue 2026-03-21 19:34:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#64