Trouble building image for ORS API


I’ve got the ORS API from a git clone (GitHub - GIScience/openrouteservice: 🌍 The open source route planner api with plenty of features.).

However i’m wishing to build an image where i use a custom osm-file (sweden-latest.osm.pbf). With this i’m seeking to push to my Azure container registry and then build an Azure container app with it.

Using docker push i’m able to push an image, but when running it it defaults to the following output:

2023-09-20T15:37:27.979832265Z 20 Sep 15:37:27 INFO [routing.RoutingProfileManager] - Total time: 21.355s.
2023-09-20T15:37:27.979906260Z 20 Sep 15:37:27 INFO [routing.RoutingProfileManager] - ========================================================================
2023-09-20T15:37:27.980363650Z 20 Sep 15:37:27 INFO [routing.RoutingProfileManager] - ====> Recycling garbage...
2023-09-20T15:37:27.980637618Z 20 Sep 15:37:27 INFO [routing.RoutingProfileManager] - Before:  Total - 1024 MB, Free - 301.45 MB, Max: 2 GB, Used - 722.55 MB
2023-09-20T15:37:28.066759306Z 20 Sep 15:37:28 INFO [routing.RoutingProfileManager] - After:  Total - 1024 MB, Free - 933.42 MB, Max: 2 GB, Used - 90.73 MB
2023-09-20T15:37:28.066834656Z 20 Sep 15:37:28 INFO [routing.RoutingProfileManager] - ========================================================================
2023-09-20T15:37:28.066872305Z 20 Sep 15:37:28 INFO [routing.RoutingProfileManager] - ====> Memory usage by profiles:
2023-09-20T15:37:28.066892343Z 20 Sep 15:37:28 INFO [routing.RoutingProfileManager] - [1] 23.04 MB (25.4%)
2023-09-20T15:37:28.066996496Z 20 Sep 15:37:28 INFO [routing.RoutingProfileManager] - Total: 23.04 MB (25.4%)
2023-09-20T15:37:28.067069903Z 20 Sep 15:37:28 INFO [routing.RoutingProfileManager] - ========================================================================

However, the osm file defined in the docker-compose.yml should result in around 537.04 MB.

This makes me believe that i have to build the image again, however with “docker compose up -d --build” i get the following error:

 => ERROR [ors-app publish 9/9] COPY --chown=ors:ors ././sweden-latest.osm.pbf /home/ors/tmp/osm_file.pbf                                                             0.0s 

Gladly accept any help

Full error message:

=> ERROR [ors-app publish 9/9] COPY --chown=ors:ors ././sweden-latest.osm.pbf /home/ors/tmp/osm_file.pbf 0.0s

[ors-app publish 9/9] COPY --chown=ors:ors ././sweden-latest.osm.pbf /home/ors/tmp/osm_file.pbf:

failed to solve: failed to compute cache key: failed to calculate checksum of ref cd2f44d1-25ea-4356-9de5-985d6fff2d26::2ur49d8w84z7ol8ic2rxr5790: “/sweden-latest.osm.pbf”: not found

I am trying to do something similar. To move openrouteservice to the cloud using Azure Container Apps. It seems to just use the default osm.pbf file, not the one I specified in the docker-compose.yml file. This work in Docker but not in the Azure Container Apps.

Most likely it does not pick up the updated docker-compose file

Any ideas way?


I think there are two problems here. One with the way openrouteservice uses docker compose and one with how Azure Container Apps (ACA) works.

The docker compose does both a docker build generating the image and a docker run to start the image.

In ACA you first upload your image and then you run your image with a set of environment variables.

When openrouteservice image that is generated is a very generic one and when you upload it to the Azure Container Register that is what you get. When you then try run, what environment variable should you use ?

There are a couple of solutions to this:

  1. Figure out which environment variables to use and run the image in ACA
  2. Run the default image and use a copy of the graphs etc to it from an existing docker compose run you have somewhere else with the graphs etc you want. This is explained in the advanced docker description in openrouteservice documentation. And then restart the ACA container.

In solution 2 the real graphs etc could be generated on a local machine and run cheaply for a week (for planet) or you can spin up a virtual machine on Azure with lots of primary memory and a a fast CPU and run it faster.

Please reply if you see any flaws in the way I describe it.