From 52cdaee41b7502377da0ac57c5d93aa7c023652f Mon Sep 17 00:00:00 2001 From: Ton Snoei Date: Mon, 20 Mar 2023 22:25:56 +0100 Subject: [PATCH] Update to 2023 versions --- Dockerfile | 2 +- README.md | 14 ++++++-------- docker-compose.yml | 2 +- entrypoint.sh | 5 ++++- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4825c1..6f0cc55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* WORKDIR /photon -ADD http://photon.komoot.de/data/photon-0.2.7.jar /photon/photon.jar +ADD https://github.com/komoot/photon/releases/download/0.4.2/photon-0.4.2.jar /photon/photon.jar COPY entrypoint.sh ./entrypoint.sh VOLUME /photon/photon_data diff --git a/README.md b/README.md index 4c663ea..d362c89 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,26 @@ -Docker: [![](https://images.microbadger.com/badges/image/thomasnordquist/photon-geocoder.svg)](https://microbadger.com/images/thomasnordquist/photon-geocoder "Get your own image badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/thomasnordquist/photon-geocoder.svg)](https://hub.docker.com/r/thomasnordquist/photon-geocoder/) [![](https://images.microbadger.com/badges/version/thomasnordquist/photon-geocoder.svg)](https://microbadger.com/images/thomasnordquist/photon-geocoder "Get your own version badge on microbadger.com") - -Github: -[![GitHub issues](https://img.shields.io/github/issues/thomasnordquist/photon-docker.svg)](https://github.com/thomasnordquist/photon-docker/issues) [![GitHub stars](https://img.shields.io/github/stars/thomasnordquist/photon-docker.svg)](https://github.com/thomasnordquist/photon-docker/stargazers) [![GitHub forks](https://img.shields.io/github/forks/thomasnordquist/photon-docker.svg)](https://github.com/thomasnordquist/photon-docker/network) - Have your own geocoder up and running within the hour, you will require about 60GB of disk space and has no further dependencies. Feel free to fork and improve. +See this [blog post]() for mor info + # Run -The image itself is pretty small, the first time the container is executed, a 30GB searchindex will be downloaded. +The image itself is pretty small, the first time the container is executed, a 60GB searchindex will be downloaded. The [blog post]() explains how to use only a specific country or region. + The data volume is exposed as `/photon/photon_data` and can be mounted, this way you'll only have to download the data once. ## With `docker run` ```bash -docker run -p 2322:2322 -it thomasnordquist/photon-geocoder:latest +docker run -p 2322:2322 -it tonsnoei/photon-geocoder:latest ``` ## Search ``` -http://localhost:2322/api?q=berlin +http://localhost:2322/api?q=amsterdam ``` *For more details on the API check the photon [github repository](https://github.com/komoot/photon).* diff --git a/docker-compose.yml b/docker-compose.yml index 47034ae..01c2f56 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: build: context: . dockerfile: Dockerfile - image: thomasnordquist/photon-geocoder:latest + image: tonsnoei/photon-geocoder:latest volumes: - data:/photon/photon_data ports: diff --git a/entrypoint.sh b/entrypoint.sh index 77f8b10..35b8011 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,7 +7,10 @@ if [ ! -d "/photon/photon_data/elasticsearch" ]; then # Let graphhopper know where the traffic is coming from USER_AGENT="docker: thomasnordquist/photon-geocoder" - wget --user-agent="$USER_AGENT" -O - http://download1.graphhopper.com/public/photon-db-latest.tar.bz2 | bzip2 -cd | tar x + # If you want to install a specific region only, enable the line below and disable the current 'wget' row. + # Take a look at http://download1.graphhopper.com/public/extracts/by-country-code for your country + wget --user-agent="$USER_AGENT" -O - http://download1.graphhopper.com/public/extracts/by-country-code/nl/photon-db-nl-latest.tar.bz2 | bzip2 -cd | tar x + # wget --user-agent="$USER_AGENT" -O - http://download1.graphhopper.com/public/photon-db-latest.tar.bz2 | bzip2 -cd | tar x fi # Start photon if elastic index exists