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
|
RUN uv run --with griffe python docs/scripts/extract_docs.py
|
||||||
|
|
||||||
# Export bibliography (gracefully handles missing bib.sqlite)
|
# Export bibliography (gracefully handles missing bib.sqlite)
|
||||||
COPY pyproject.toml .
|
|
||||||
COPY data/bib.sqlit[e] data/
|
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
|
# Stage 2: Build Docusaurus static site
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ import json
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from conf import path as _conf_path
|
BIB_DB = Path("data/bib.sqlite")
|
||||||
|
|
||||||
BIB_DB = _conf_path("db.bib")
|
|
||||||
OUT_PATH = Path("docs/static/library.json")
|
OUT_PATH = Path("docs/static/library.json")
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +30,15 @@ def main() -> None:
|
|||||||
|
|
||||||
# Import here so griffe stage doesn't need bib deps
|
# Import here so griffe stage doesn't need bib deps
|
||||||
sys.path.insert(0, str(Path("src").resolve()))
|
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))
|
store = Store(str(BIB_DB))
|
||||||
items = store.list_items()
|
items = store.list_items()
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ RUN uv python install ${PYTHON_VERSION} \
|
|||||||
# Create marimo config directory and config
|
# Create marimo config directory and config
|
||||||
RUN mkdir -p /home/${USERNAME}/.config/marimo
|
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} .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
|
EXPOSE 2718
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user