My goal is to be able to generate the openroute database on another machine and then copy the files to a version of openroute on another production machine, restart openroute and then magically it would have another region or a bigger region.
I do this so I do not have to bother the production machine with the initial generation of the graphs etc. and this can happen in the background.
To do this I created docker volumes for all the ors-core/data directories in this way:
volumes:
- graph-volume:/home/ors/ors-core/data/graphs
- elevation-volume:/home/ors/ors-core/data/elevation_cache
- ors-logs-volume:/home/ors/ors-core/logs/ors
- tomcat-logs-volume:/home/ors/tomcat/logs
- ors-config-volume:/home/ors/ors-conf
- ./denmark-latest.osm.pbf:/home/ors/ors-core/data/osm_file.pbf
- osm-file-volume:/home/ors/ors-core/data
environment:
- BUILD_GRAPHS=True # 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 -Xms5g -Xmx10g"
- "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"
volumes:
graph-volume:
external: true
elevation-volume:
external: true
ors-logs-volume:
external: true
tomcat-logs-volume:
external: true
osm-file-volume:
external: true
ors-config-volume:
external: true
And I can use docker cp to move the files from the generation machine to the production machine.
But when I restart openroute, it still is using the old database even if I deleted it. So I assume the restart is using data from somewhere else!
Is this a correct way of doing this or does someone have a better idea of doing this.