Hosting - Open Source Routing Machine (OSRM)

Hi Render Team,
I want to deploy Open Source Routing Machine (OSRM) with docker. Is there any guide to translate docker-compose to ‘render.yaml’ file.

Here is my docker-compose file:

osrm-data:
  image: sp/osrm5
  volumes:
- /data
osrm:
  image: sp/osrm5 
  volumes_from: 
- osrm-data
  ports:
- 5000:5000
  command: ./start.sh Nepal http://download.geofabrik.de/asia/nepal-latest.osm.pbf

Plus, which plan and services(Web/Private) should i choose from the dashboard?

Thanks

Hey there,

  • Render will automatically handle port detection, so that doesn’t need to be added to the render.yaml file.
  • The volumes can be handled by defining a Render disk for your service. You just define the directory that you want persisted across deploys. In this case it seems to be /data
  • The value you currently have for command should be your service’s start command.

Web services are accessible over the internet while private services can only be accessed by other Render services. If you plan to us this to create a public facing web site or API, I would suggest using a web service.

Let me know how this works for you!

Hi Jake,
Thank you for your response. Issue has been solved.

As you mentioned above disk and port was auto handled by render.

And, here is the code of my docker file. (For those who are/will be facing same issue)

FROM osrm/osrm-backend

WORKDIR /data

RUN apt-get update && apt-get install -y --no-install-recommends curl

RUN curl http://download.geofabrik.de/asia/nepal-latest.osm.pbf --output np-latest.osm.pbf && \
    osrm-extract -p /opt/car.lua np-latest.osm.pbf && \
    osrm-partition np-latest.osrm && \
    osrm-customize np-latest.osrm

CMD ["osrm-routed", "--algorithm", "mld", "np-latest.osrm", "--max-matching-size","1000", "--max-table-size","1000"]
1 Like