Update to 2023 versions

This commit is contained in:
Ton Snoei 2023-03-20 22:25:56 +01:00
parent b0e785b0a0
commit 52cdaee41b
4 changed files with 12 additions and 11 deletions

View File

@ -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

View File

@ -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).*

View File

@ -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:

View File

@ -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