photon-docker/entrypoint.sh

23 lines
978 B
Bash
Raw Normal View History

2017-07-19 12:54:37 +02:00
#!/bin/bash
2017-07-19 12:54:37 +02:00
# Download elasticsearch index
if [ ! -d "/photon/photon_data/elasticsearch" ]; then
echo "Downloading search index"
# Let graphhopper know where the traffic is coming from
USER_AGENT="docker: thomasnordquist/photon-geocoder"
2023-03-20 22:25:56 +01:00
# 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
2023-03-20 22:32:55 +01:00
# 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
2017-07-19 12:54:37 +02:00
fi
# Start photon if elastic index exists
if [ -d "/photon/photon_data/elasticsearch" ]; then
echo "Start photon"
java -jar photon.jar $@
else
echo "Could not start photon, the search index could not be found"
fi