diff --git a/docker-compose.yaml b/docker-compose.yaml index 3d58312..d845063 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -141,7 +141,12 @@ services: valhalla: image: ghcr.io/valhalla/valhalla:3.9.1 restart: unless-stopped - command: ["bash", "-c", "until [ -f /data/routing/service.sh ]; do sleep 5; done; exec bash /data/routing/service.sh"] + depends_on: + - maptool + # maptool copies the deployed script here at boot. On a redeploy the + # old copy is still there, so wait (up to a minute) for a fresh one; + # a restart of this container alone runs the one that's there. + command: ["bash", "-c", "s=/data/routing/service.sh; t=$$(date +%s); until [ -f $$s ] && { [ $$(stat -c %Y $$s) -ge $$t ] || [ $$(($$(date +%s) - t)) -gt 60 ]; }; do sleep 2; done; exec bash $$s"] volumes: # :z, shared for the same reason as maptool's own ./data mount above. - ./data:/data:z