#!/bin/sh set -e REGION="${OSRM_REGION:-connecticut-latest}" PBF="/data/${REGION}.osm.pbf" OSRM="/data/${REGION}.osrm" PROFILE="${OSRM_PROFILE:-/opt/car.lua}" # The PBF is downloaded by the osrm-download service before this container starts. if [ ! -f "$PBF" ]; then echo "[osrm] ERROR: $PBF not found. The osrm-download service should have fetched it." exit 1 fi # Preprocess if .osrm files are missing if [ ! -f "$OSRM" ]; then echo "[osrm] Extracting road network (this takes a few minutes)..." osrm-extract -p "$PROFILE" "$PBF" echo "[osrm] Partitioning..." osrm-partition "$OSRM" echo "[osrm] Customizing..." osrm-customize "$OSRM" echo "[osrm] Preprocessing complete." fi echo "[osrm] Starting routing engine..." exec osrm-routed --algorithm mld "$OSRM"