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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user