Skip to content

Latest commit

 

History

History
73 lines (59 loc) · 4.22 KB

README.md

File metadata and controls

73 lines (59 loc) · 4.22 KB

osrm-backend-docker

CircleCI

Docker image for the Open Source Routing Machine (OSRM) osrm-backend.

Supported tags and respective Dockerfile links

For earlier versions see releases and the available tags on Docker Hub.

Usage

Pass the OSRM_PBF_URL environment variable to the container referencing the URL of your PBF file:

docker run -d -p 5000:5000 \
-e OSRM_PBF_URL='http://download.geofabrik.de/asia/maldives-latest.osm.pbf' \
--name osrm-backend peterevans/osrm-backend:latest

The PBF file will be downloaded and the graph will begin building. Note that very large graphs may take hours to be built.

Tail the logs to verify the graph has been built and osrm-backend is serving requests:

docker logs -f <CONTAINER ID>

Then point your web browser to http://localhost:5000/

For API documentation see http://project-osrm.org/docs/v5.15.2/api/

Graph Profiles

The graph profile will default to car. Other profiles can be specified with the OSRM_GRAPH_PROFILE environment variable:

docker run -d -p 5000:5000 \
-e OSRM_PBF_URL='http://download.geofabrik.de/asia/maldives-latest.osm.pbf' \
-e OSRM_GRAPH_PROFILE='bicycle' \
--name osrm-backend peterevans/osrm-backend:latest

Available profiles are car,bicycle and foot.

Custom Graph Profiles

The URL to a custom graph profile can be passed via the OSRM_GRAPH_PROFILE_URL environment variable. If this variable is set it will override any profile set by OSRM_GRAPH_PROFILE.

docker run -d -p 5000:5000 \
-e OSRM_PBF_URL='http://download.geofabrik.de/asia/maldives-latest.osm.pbf' \
-e OSRM_GRAPH_PROFILE_URL='https://raw.githubusercontent.com/peter-evans/osrm-backend-docker/master/tests/car.lua' \
--name osrm-backend peterevans/osrm-backend:latest

Data Storage Location

By default the graph will be built and stored at the path /osrm-data. A custom path can be specified with the OSRM_DATA_PATH environment variable. Note that the path should NOT contain a trailing slash (/).

docker run -d -p 5000:5000 \
-e OSRM_PBF_URL='http://download.geofabrik.de/asia/maldives-latest.osm.pbf' \
-e OSRM_DATA_PATH='/my-custom-path' \
--name osrm-backend peterevans/osrm-backend:latest

Persistent Storage

For a solution to persisting graph data and immutable deployments check out osrm-backend for Kubernetes.

License

MIT License - see the LICENSE file for details