Docker compose issues

I am attempting to use the docker for ORS for the first time, and I am running into some issues. In particular, when I run docker compose up -d, I get this error message:

> ERROR [ors-app base 4/5] RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,source=requirements.txt,target=requirements.txt python -m pip i 0.0s

I’m not experienced enough to know what this means or how to fix it. Any advice?

This almost doesn’t look like an ors issue. Can you please share your docker-compose.yml with us?

Sure! Here it is:

# ##### openrouteservice settings file #####
# # This file contains parameters for openrouteservice.
# # For a full list of possible parameters see https://giscience.github.io/openrouteservice/run-instance/configuration/

 ##### General server settings #####
routing:
  enabled: true
  attribution: openrouteservice.org, OpenStreetMap contributors, tmc - BASt
  gpx_name: ORSRouting
  gpx_description: This is a directions instructions file as GPX, generated from openrouteservice
  gpx_base_url: https://openrouteservice.org/
matrix:
  enabled: true
  attribution: openrouteservice.org, OpenStreetMap contributors  
  maximum_routes: 1000000
  maximum_routes_flexible: 25
  maximum_visited_nodes: 100000
  maximum_search_radius: 2000
  u_turn_costs: -1
  isochrones:
    profiles:
    car:
      enabled: true
      profile: driving-car
      elevation: true
    bike-regular:
      enabled: true
      profile: cycling-regular

I’m very new to docker and .yml files, so I would not be surprised if the issue is, in fact, somewhere in here.

:slight_smile: That is your openrouteservice configuration file.

The docker-compose.yml is another file.

If you don’t know which one, please provide us with a bullet point list (from the very first step, e.g. repo checkout, etc.) of steps you do to get to that error message. Maybe that’ll help us understand the problem better.

I see. It appears I sent you an old version from when I was even more confused than I currently am. Here is what I believe should be correct:

  # ------------------ JAVA OPTS ------------------ #
  # Configure the memory settings for JAVA or pass additional opts
  # Fore more available ENV properties see Prepare CATALINA_OPTS and JAVA_OPTS
  # in https://github.com/GIScience/openrouteservice/blob/main/docker-entrypoint.sh
  XMS: 1g  # start RAM assigned to java
  XMX: 2g  # max RAM assigned to java. Rule of Thumb: <PBF-size> * <profiles> * 2
  # Example: 1.5 GB pbf size, two profiles (car and foot-walking)
  # -> 1.5 * 2 * 2 = 6. Set xmx to be AT LEAST `-Xmx6g`
  ADDITIONAL_JAVA_OPTS: ""  # further options you want to pass to the java command

  # ----------------- Properties configuration ------------------- #
  # Configure your whole container with only property ENVs.
  # These can be set alternatively or additionally to the yml configuration file.
  # Note, that any values set will override the corresponding values from the yml configuration file.
  # See the ors-config.env file for more options.
  # To have a configuration file-less container, uncomment at least the following properties.
  # The values are examples and provide the default configuration.
  ors.engine.source_file: /home/ors/files/north-america-latest.osm.gz
  #ors.engine.graphs_root_path: /home/ors/graphs
  #ors.engine.elevation.cache_path: /home/ors/elevation_cache
  ors.engine.profiles.car.enabled: true

# ----------------- ENV file configuration ------------------- #
# Too many variables for your 'environment:' section?
# Use an env_file with the ENV properties instead and define everything in there:
# Values will be overwritten if set in the 'environment' section.
#env_file: ors-config.env

# ----------------- Healthcheck configuration ------------------- #
# The healthcheck is disabled by default. Uncomment the following lines to enable it.
# The healthcheck allows you to monitor the status of the ORS application.
# Be careful with long graph builds, as the healthcheck will fail and show 'unhealthy' during this time.
# This is especially useful if you run your ORS container in a production environment.
#healthcheck:
#  test: wget --no-verbose --tries=1 --spider http://localhost:8082/ors/v2/health || exit 1
#  start_period: 1m
#  interval: 10s
#  timeout: 2s
#  retries: 3
#  disable: false

In response to your question, my steps are:

  1. Launch the docker desktop app.
  2. Go to VS Studio and use the terminal to CD into the directory where my files are stored.
  3. Type docker compose up -d
  4. Wait while it initializes.
  5. Get an error message.

I am now (as of about an hour ago) getting a new error message with this system. The error is:

HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /ors/v2/matrix/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001DE27CDD0D0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

This comes in the Python cell in which I request information from ORS, which I do as follows:


body = {"locations":wednesday_addresses["Reversed Coordinates"].to_list(),"metrics":["duration"]}

headers = {
    'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
    'Authorization': '**my authorizatoin key**',
    'Content-Type': 'application/json; charset=utf-8'
}

wednesday_call = requests.post('http://localhost:8080/ors/v2/matrix/', json=body, headers=headers)

print(wednesday_call.status_code, wednesday_call.reason)
print(wednesday_call.text)

wednesday_durations = json.loads(wednesday_call.text)['durations']

i = 0
for list in wednesday_durations:
    wednesday_adjacencymatrix.iloc[i] = list
    i = i + 1

Do you have any thoughts on this?

Hi @Cin_Dacey_Ahrens,

north america latest is currently at 14.4 GB
you won’t be able to run it with

  XMS: 1g  # start RAM assigned to java
  XMX: 2g # max RAM assigned to java. Rule of Thumb: <PBF-size> * <profiles> * 2
  # Example: 1.5 GB pbf size, two profiles (car and foot-walking)
  # -> 1.5 * 2 * 2 = 6. Set xmx to be AT LEAST `-Xmx6g`

see example equation ^

You can try running this with MMAP with lower RAM settings.

Make sure your local ors reports ready before expecting valid requests.

Best regards