Skip to content

Instantly share code, notes, and snippets.

@bluetoothfx
Last active April 16, 2020 12:54
Show Gist options
  • Save bluetoothfx/22a939be64bbca0a36a59396c02249a0 to your computer and use it in GitHub Desktop.
Save bluetoothfx/22a939be64bbca0a36a59396c02249a0 to your computer and use it in GitHub Desktop.
Docker hosting OSRM backend & front end
# Open a folder & start to run below commands from terminal
# download desired map segment (example Germany)
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
# Pre process data - Step 01
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
# Step 02
> docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
# Step 03
> docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
# Last step:
> docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
## To check please run following commands from terminal:
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
curl "http://127.0.0.1:5000/match/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?steps=true&geometries=polyline6&overview=full&annotations=false"
If you need to run frontend:
> docker run -p 9966:9966 osrm/osrm-frontend
#references:
https://github.com/Project-OSRM/osrm-backend
https://hub.docker.com/r/osrm/osrm-backend/
https://github.com/Project-OSRM/osrm-frontend
https://hub.docker.com/r/osrm/osrm-frontend/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment