Files
Xpress-rider/deploy/osrm/docker-compose.yml
2026-08-12 10:50:45 +05:30

41 lines
1.1 KiB
YAML

# Self-hosted OSRM routing backend.
#
# Run the one-off preprocessing in ./README.md FIRST — this file only serves
# the already-built graph.
#
# docker compose up -d
#
# Then point the app at it:
# flutter build apk --dart-define=OSRM_BASE_URL=http://your-host:5000
services:
osrm:
image: ghcr.io/project-osrm/osrm-backend:latest
container_name: nearle-osrm
restart: unless-stopped
command: >
osrm-routed
--algorithm mld
--max-table-size 8000
/data/${OSRM_REGION:-southern-zone-latest}.osrm
volumes:
- ./data:/data:ro
ports:
- "5000:5000"
healthcheck:
# Coimbatore -> a nearby point; fails loudly if the graph did not load.
test:
- CMD-SHELL
- >-
wget -qO- "http://localhost:5000/route/v1/driving/76.9558,11.0168;76.9776,10.9984"
| grep -q '"code":"Ok"' || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
# Southern-zone MLD needs well under this; raise for all-India.
memory: 4G