Restarting Docker


Each time I restart my container it override my graphs directory mentioned in docker-compose.

I changed Build_GRAPHS = False, i tried to remove ./graphs path to make them permanent and alos changed them several times, but each time it overrides my graphs directory and restart the generation.

Any idea how to persist graphs paths when we have graphs already built?!


Hi @hamzarhaiem

if you are using docker-compose, it should save them using the path mapped to the volume. One thing I found with compose though is that if you change the yaml file, you must take down and bring back up the container for the changes to take effect - a simple docker-compose restart doesn’t apply the changes.

Thanks @adam, in fact i tried to change Build_GRAPHS = False and restart the container docker restart ors-app after the generation is done and directly it override my graphs!

Even moving graphs directory and point to them in the docker-compose and restart the container will override the graphs directory.


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/europe-latest.osm.pbf
      - ./persist/graphs:/ors-core/data/graphs
      - ./persist/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 -Xms45g -Xmx45g"
      - " -Djava.rmi.server.hostname=localhost"

How can i restart the container without overriding my graphs directory?

PS: I’am using ORS 6.3 and i was able to restart container normally in ORS 5.0.2 by only changing graphs paths


Rebuilding with docker restart will not work after changing the file, as docker itself knows nothing about the compose file and its parameters. As far as it is concerned, the environment value is still set to false. You MUST build it with docker-compose if you are making changes to the compose file (docker-compose down and then docker-compose up).