forked from tonsnoei/photon-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·22 lines (18 loc) · 971 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# 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: tonsnoei/photon-geocoder"
# 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
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