Hi,
Im trying to localy run the route optimzation locally. I get the local ors to work. But when i post the following example:
import requests
body = {
"jobs": [
{"id": 1, "service": 300, "amount": [1], "location": [57.7072, 11.9668]},
{"id": 2, "service": 300, "amount": [1], "location": [57.6955, 11.9926]},
{"id": 3, "service": 300, "amount": [1], "location": [57.7104, 11.9658]},
{"id": 4, "service": 300, "amount": [1], "location": [57.6838, 11.9487]}
],
"vehicles": [
{
"id": 1,
"profile": "driving-hgv",
"start": [57.7072, 11.9668],
"end": [57.7072, 11.9668],
"capacity": [2000]
}
],
"options": {"g": 'true'}
}
headers = {
'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
'Content-Type': 'application/json; charset=utf-8'
}
response = requests.post('http://localhost:3000', json=body, headers=headers)
print(response.json())
‘Vroom Response:
{
“code”: 3,
“error”: “Failed to connect to 0.0.0.0:8080”
}’
This is my current set up:
docker-compose:
version: '3.8'
services:
ors-app:
build:
context: ./
container_name: ors-app
ports:
- "8080:8082"
- "9001:9001"
image: openrouteservice/openrouteservice:v8.0.0
volumes:
- ./ors-docker:/home/ors
environment:
REBUILD_GRAPHS: False
CONTAINER_LOG_LEVEL: INFO
XMS: 4g
XMX: 8g
ADDITIONAL_JAVA_OPTS: ""
vroom:
image: ghcr.io/vroom-project/vroom-docker:latest
ports:
- "3000:3000"
volumes:
- ./vroom/config.yml:/conf/config.yml
environment:
- VROOM_ROUTER=ors
Vroom config:
cliArgs:
geometry: false # retrieve geometry (-g)
planmode: false # run vroom in plan mode (-c) if set to true
threads: 4 # number of threads to use (-t)
explore: 5 # exploration level to use (0..5) (-x)
limit: '1mb' # max request size
logdir: '/..' # the path for the logs relative to ./src
logsize: '100M' # max log file size for rotation
maxlocations: 1000 # max number of jobs/shipments locations
maxvehicles: 200 # max number of vehicles
override: true # allow cli options override (-c, -g, -t and -x)
path: '' # VROOM path (if not in $PATH)
port: 3000 # expressjs port
router: 'ors' # routing backend (osrm, libosrm or ors)
timeout: 300000 # milli-seconds
baseurl: '/' #base url for api
routingServers:
osrm:
car:
host: '0.0.0.0'
port: '5000'
bike:
host: '0.0.0.0'
port: '5001'
foot:
host: '0.0.0.0'
port: '5002'
ors:
driving-car:
host: '0.0.0.0/ors/v2'
port: '8080'
driving-hgv:
host: '0.0.0.0/ors/v2'
port: '8080'
cycling-regular:
host: '0.0.0.0/ors/v2'
port: '8080'
cycling-mountain:
host: '0.0.0.0/ors/v2'
port: '8080'
cycling-road:
host: '0.0.0.0/ors/v2'
port: '8080'
cycling-electric:
host: '0.0.0.0/ors/v2'
port: '8080'
foot-walking:
host: '0.0.0.0/ors/v2'
port: '8080'
foot-hiking:
host: '0.0.0.0/ors/v2'
port: '8080'
valhalla:
auto:
host: '0.0.0.0'
port: '8002'
bicycle:
host: '0.0.0.0'
port: '8002'
pedestrian:
host: '0.0.0.0'
port: '8002'
motorcycle:
host: '0.0.0.0'
port: '8002'
motor_scooter:
host: '0.0.0.0'
port: '8002'
taxi:
host: '0.0.0.0'
port: '8002'
hov:
host: '0.0.0.0'
port: '8002'
truck:
host: '0.0.0.0'
port: '8002'
bus:
host: '0.0.0.0'
port: '8002'
ors-config:
ors:
engine:
source_file: /home/ors/files/sweden-latest.osm.pbf
profiles:
hgv:
enabled: true