kiwix waits for a non-empty ZIM instead of a restart loop (on the car's server each restart's veth set off avahi's mDNS announcements and filled the Pi's Wi-Fi); pull-maps drops a connection a minute without data so the retry resumes (Wi-Fi switched under it)
CI / check (push) Successful in 22s
CI / deploy (push) Successful in 17s

This commit is contained in:
randy committed 2026-11-29 17:03:53 +01:00
1 parent f9fbcdbbc5
commit ea14b110e6
2 files changed
+10 -3

No files matched your search

+7 -2
View File
@@ -105,8 +105,11 @@ services:
# offline.pmtiles/terrain.pmtiles). On the default compose network (not
# network_mode: "service:maptool" — KIWIX_URL above reaches it by this
# service's own name), so maptool and kiwix stay independent containers.
# Keeps restarting (harmlessly) if data/kiwix/wikipedia.zim isn't there
# yet — GET /api/kiwix just reports unavailable until it comes up.
# Waits (entrypoint below) while data/kiwix/wikipedia.zim is missing or
# empty — GET /api/kiwix just reports unavailable until it comes up. Not
# a restart loop: on the car's server (host network, placeholder ZIM
# until the map pull brings it) one restart a second meant a new veth
# each time, and avahi's mDNS announcements of them filled the Pi's Wi-Fi.
#
# The volume binds the exact *file* path, not the data/kiwix/ directory —
# deliberately, so data/kiwix/wikipedia.zim can be a symlink to wherever
@@ -131,6 +134,8 @@ services:
# this same prefix off incoming request paths, so both ends agree on
# it) — no ports: mapping needed, nothing outside the compose network
# ever talks to this container directly.
# The image's own entrypoint (dumb-init, start.sh), after the wait.
entrypoint: ["/usr/bin/dumb-init", "--", "sh", "-c", "until [ -s /data/wikipedia.zim ]; do sleep 60; done; exec /usr/local/bin/start.sh \"$$@\"", "kiwix"]
command: ["--urlRootLocation=/kiwix", "/data/wikipedia.zim"]
volumes:
# :z, shared for the same reason as maptool's own ./data mount above.