fix(demo): repair Kiwix service with catalog-based ZIM bootstrap

Kiwix was failing to start: its inline bootstrap command had a shell
syntax error (a YAML-wrapped multi-line wget left a dangling `||`), and
the hard-coded sample-ZIM URL returned 404 because Kiwix rotates the
date-stamped filenames monthly.

Replace the inline command with a bind-mounted bootstrap script that
resolves the current ZIM filename from the Kiwix OPDS catalog at startup,
so the download URL never rots. kiwix-serve is also started on port 8080
to match the container port mapping and healthcheck (it defaults to 80).

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
This commit is contained in:
2026-07-30 13:00:54 -05:00
parent b286b0a305
commit 92a0fd76cb
2 changed files with 48 additions and 15 deletions
+3 -15
View File
@@ -750,23 +750,11 @@ services:
- "${KIWIX_PORT}:8080"
volumes:
- ${COMPOSE_PROJECT_NAME}_kiwix_data:/data
- ./config/kiwix/bootstrap.sh:/bootstrap.sh:ro
entrypoint: []
command:
- /bin/sh
- -c
- |
if ! ls /data/*.zim 1>/dev/null 2>&1; then
echo 'No ZIM files found. Downloading sample ZIM...';
wget -q -O /data/demo.zim
'https://download.kiwix.org/zim/other/bleedingedge_climate-change_en.zim'
|| echo 'Download failed';
fi
if ls /data/*.zim 1>/dev/null 2>&1; then
exec kiwix-serve /data/*.zim
else
echo 'No ZIM files available, sleeping indefinitely'
exec sleep infinity
fi
- sh
- /bootstrap.sh
environment:
- PUID=${DEMO_UID}
- PGID=${DEMO_GID}