OSRM routing API for Ethiopia
# OSRM Routing API
Routing and distance calculation service for Ethiopia, powered by OSRM. Built for food delivery apps, ride-sharing, or any service that needs real road distance and duration.
## Features
- **4 vehicle profiles**: car, motorcycle, bicycle, foot
- **Real road routing** using OpenStreetMap data for Ethiopia
- **Monthly auto-update** for map data
- **Run anywhere**: Docker (self-hosted) or Cloudflare Containers (serverless)
- **Same API** for both — pick whichever fits your setup
## Choose Your Platform
| | Docker | Cloudflare Containers |
|---|---|---|
| **Cost** | Your own server | Workers Paid plan |
| **Setup** | `docker compose up` | `npx wrangler deploy` |
| **Cold start** | Instant | ~5 min (first time) |
| **Monthly update** | Cron container | Worker cron trigger |
| **Scaling** | Manual | Automatic |
---
## Docker (Self-Hosted)
### Quick Start
```bash
docker compose up -d
```
On first run, it downloads Ethiopia OSM data (~133MB) and processes it for all profiles (~5 min). After that, services start automatically.
### Monthly Map Updates
Automatic on the 1st of every month at 3:00 AM. The `map-updater` container downloads fresh data from Geofabrik, reprocesses all profiles, and restarts the routing services.
To run manually:
```bash
docker exec osrm-map-updater /usr/local/bin/update-map.sh
```
### Stopping
```bash
docker compose down
```
---
## Cloudflare Containers (Serverless)
### Prerequisites
- Wrangler CLI installed
- Cloudflare account (Workers Paid plan required for Containers)
### Setup & Deploy
```bash
pnpm install
pnpm deploy
```
This will:
1. Build a single Docker image with all 4 OSRM profiles + the API
2. Push it to Cloudflare's container registry
3. Deploy the Worker that routes to the container
### How it Works
Everything runs in **one container** (no docker-compose):
```
┌──────────────────────────────────────────────┐
│ Cloudflare Container │
│ …