How can I use the country specific backend APIs locally?

Hey guys,

I have tried running openrouteservice locally using docker-compose.

I ran this command

docker pull openrouteservice/openrouteservice
docker run -p 8080:8080 openrouteservice/openrouteservice

However, this was not working for me, when I try to hit the /health endpoint it hangs the request. ( I’m on M1 Macbook )

I thought I’m not providing the pbf file. So I downloaded the pbf file for India and placed in data/india-latest.osm.pbf and then updated the docket-compose file.

version: '2.4'
services:
  ors-app:
    container_name: ors-app
    ports:
      - 8080:8080
      - 9001:9001
    image: openrouteservice/openrouteservice:latest
    build:
      context: ../
      args:
        ORS_CONFIG: ./conf/ors-config.json
        OSM_FILE: ./data/india-latest.osm.pbf
    user: "${ORS_UID:-0}:${ORS_GID:-0}"
    volumes:
      - ./graphs:/ors-core/data/graphs
      - ./elevation_cache:/ors-core/data/elevation_cache
      - ./logs/ors:/var/log/ors
      - ./logs/tomcat:/usr/local/tomcat/logs
      - ./conf:/ors-conf
      - ./data/india-latest.osm.pbf:/ors-core/data/osm_file.pbf
    environment:
      - BUILD_GRAPHS=FalsTrue  # Forces the container to rebuild the graphs, e.g. when PBF is changed
      - "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g"
      - "CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost"

Any kind of help is appreciated.

Hey,

when running via docker run, have a look at our backend documentation.

In your case, you’re missing these two parameters:

 -v $PWD/graphs:/ors-core/data/graphs
 -v $PWD/elevation_cache:/ors-core/data/elevation_cache

as your docker logs should tell you.

When running via docker-compose, note that building India will take rather long, don’t expect the service to be running in less than one hour.

Best regards

Thanks for your reply! I tried in non-m1 MacBook and it works.
Looks like we are not supporting Silicon Chip yet.

1 Like

Hey,

yeah, there’s an open issue regarding running the ors on M1 MacBooks - is that the same issue you’re experiencing?

Best regards

Yes, I was on M1 where it was not working.

1 Like