GraphHopper.com | Forum | GitHub | Maps | Blog

Docker files need an update


#1

Hi,
First of all, a big thank you for the amazing work !
I have been benchmarking Grapphhopper against OSRM and Graphhopper seems to be more accurate and more flexible than OSRM in many areas.

Now while testing Grapphopper I’ve run into several issues. I’m using the master branch. Also, I’m neither a Java or Docker expert so everything that follows may well be wrong.

Since there was a docker-compose/dockerfile available I tried using them. They don’t work out of the box. Here are a few things that seem outdated:

  • The Dockerfile calls a ./graphhopper.sh buildweb command which has been removed since d6f14bc7b42e647d7402f3551a03c38f50fe539d and replaced with build
  • The default config binds the web server to localhost which is incompatible with docker (needs it to bind to 0.0.0.0)
  • I’m wasn’t able to reach the jetty server on port 11111 and had to add the 8989 port binding to be able reach the API (BTW I’m not sure what’s supposed to run on port 11111)

Is this correct or did I miss something ?


#2

Yeah, we refactored several things in 0.11 but forgot about docker.

I’m also no real docker export … but will the following changes fix the problems you have?


#3

Hi karusell,
Thank you for your help.

I think there are two sides to this issue:

  • Dockerfile, I was able to get it to work using:
docker build . -t graphhopper-docker-fix
docker run -d --name graphhopper-docker-fix -v <path-to-repo>/data:/data -p 11111:11111 graphhopper-docker-fix:latest

The -p 11111:11111 is required to be able to reach the api in the container from outside the container.

  • core/files/docker-compose.yml: which your changes do not fix but the readme on github recommends. Maybe this one could be deleted and a bit of documentation around the Dockerfile could be added (I’m willing to spend some time on it, if you want).

#4

Thanks for your feedback, will try to fix this or if you have time for a pull request this would be appreciated too :slight_smile:


#5

Ok I’ll try to submit a pull request.