Setup with Docker

Hello Guys,

i am new to Ubuntu, Docker and ORS and i’ve got big problems with the setup. The documentation on GitHub doesn’t tell me what to do after installing docker and the ORS Image with
docker pull giscience/openrouteservice
i tried
docker pull openrouteservice/openrouteservice
too, but i dont know how to go on.
Where i need to swap the Heidelberg Data with my own?
How i can fire a local request??

For Newbies like me, its very hard to understand what to do. I would love a Tutorial (-Video) for setting up the service local.
When i do
docker run imageID
it just stop after 68 seconds and i cant work with the shell anymore. Looks like its still working…
And im still waiting for finish after half an hour.
I dont know what to do…
Any help?

There are a number of instructions in our GitHub that guide you through the process of running in docker and changing osm files:

It is generally better to install with docker-compose as that makes the process of creating volumes and such much easier. And then once it is up and running you request as you would with the public api, but rather than using (for example) you would use http://localhost:8080/ors/v2/directions

Thanks for your fast answer. I will try and i hope it will work :slight_smile:

Hi, I’m trying to build an instance in my local machine, and changed the OSM_FILE arg as in the documentation, however, when I build the app it uses the default to the heidelberg osm file regardless.
I’m not very experienced with docker :confused: I coppied the osm file I need to use in the same folder where the heildeberg file is located and its named scl.osm
Here is my .yml file:

version: '2.4'
    container_name: ors-app
     - 8080:8080
     - 9001:9001
   image: openrouteservice/openrouteservice:latest
     context: ../
      APP_CONFIG: ./openrouteservice/src/main/resources/app.config.sample
      OSM_FILE: ./openrouteservice/src/main/files/scl.osm
    - ./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
    #- ./your_osm.pbf:/ors-core/data/osm_file.pbf
   - BUILD_GRAPHS=False  # 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"
   - " -Djava.rmi.server.hostname=localhost"

my osm is the scl.osm file, the app runs but will only route heildeberg coordinates :’(

Hi @saguerraty,
I think this is most likely because it has built the graphs for heidelberg before, and so it wont build new ones unless you tell it to or it cant find the already built graphs. The two ways of doing that is to either completely delete the contents of the ./graphs folder on your host, or to set the parameter BUILD_GRAPHS=True in the compose file. If you do the latter though, every time the container starts up the graphs will be rebuilt, so often deleting the contents of the graphs folder is the easiest solution.

Just to complement Adams answer:

You’re trying to specify your file in the docker build section, which only takes effect when you build the image locally. If you instead use the volume mapping, it’ll work. You’ll still have to delete the graphs folder now, since you likely already generated the graph. It’s more for next time you start a fresh container.

Thanks for the reply :smiley: