fix deploy image builds: notebooks COPY path, docs pydantic fallback (fix #44)
- notebooks/Dockerfile: fix COPY path for retro-arcade.css to .marimo-config/ - docs/Dockerfile: drop pyproject.toml COPY, use python3 directly - docs/scripts/export_library.py: remove conf import (hardcode data/bib.sqlite), gracefully handle missing pydantic in Docker extract stage
This commit is contained in:
@@ -11,9 +11,8 @@ COPY docs/scripts/ docs/scripts/
|
||||
RUN uv run --with griffe python docs/scripts/extract_docs.py
|
||||
|
||||
# Export bibliography (gracefully handles missing bib.sqlite)
|
||||
COPY pyproject.toml .
|
||||
COPY data/bib.sqlit[e] data/
|
||||
RUN uv run python docs/scripts/export_library.py
|
||||
RUN python3 docs/scripts/export_library.py
|
||||
|
||||
|
||||
# Stage 2: Build Docusaurus static site
|
||||
|
||||
@@ -15,9 +15,7 @@ import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from conf import path as _conf_path
|
||||
|
||||
BIB_DB = _conf_path("db.bib")
|
||||
BIB_DB = Path("data/bib.sqlite")
|
||||
OUT_PATH = Path("docs/static/library.json")
|
||||
|
||||
|
||||
@@ -32,7 +30,15 @@ def main() -> None:
|
||||
|
||||
# Import here so griffe stage doesn't need bib deps
|
||||
sys.path.insert(0, str(Path("src").resolve()))
|
||||
from bib.store import Store
|
||||
try:
|
||||
from bib.store import Store
|
||||
except ImportError as exc:
|
||||
print(f"bib deps not available ({exc}), writing empty library.json")
|
||||
OUT_PATH.parent.mkdir(parents=True, exist_ok=True)
|
||||
OUT_PATH.write_text(
|
||||
json.dumps({"items": [], "collections": [], "tags": []}, indent=2)
|
||||
)
|
||||
return
|
||||
|
||||
store = Store(str(BIB_DB))
|
||||
items = store.list_items()
|
||||
|
||||
@@ -46,7 +46,7 @@ RUN uv python install ${PYTHON_VERSION} \
|
||||
# Create marimo config directory and config
|
||||
RUN mkdir -p /home/${USERNAME}/.config/marimo
|
||||
COPY --chown=${USER_UID}:${USER_GID} .marimo.toml /home/${USERNAME}/.config/marimo/marimo.toml
|
||||
COPY --chown=${USER_UID}:${USER_GID} retro-arcade.css /home/${USERNAME}/.config/marimo/retro-arcade.css
|
||||
COPY --chown=${USER_UID}:${USER_GID} .marimo-config/retro-arcade.css /home/${USERNAME}/.config/marimo/retro-arcade.css
|
||||
|
||||
EXPOSE 2718
|
||||
|
||||
|
||||
Reference in New Issue
Block a user