Skip to content
Snippets Groups Projects
Commit 6986009d authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

Put updates in containers

parent 44ecfda5
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,25 @@ fi
# Start photon if elastic index exists
if [ -d "/photon/photon_data/elasticsearch" ]; then
echo "Starting photon"
java -jar photon.jar -host nominatim -port 5432 -database nominatim -user nominatim -password password1234
java -jar photon.jar -host nominatim -port 5432 -database nominatim -user nominatim -password password1234 &
### Start continuous update ###
while true; do
starttime=$(date +%s)
curl http://localhost:2322/nominatim-update
# sleep a bit if updates take less than 5 minutes
endtime=$(date +%s)
elapsed=$((endtime - starttime))
if [[ $elapsed -lt 300 ]]; then
sleepy=$((300 - $elapsed))
echo "Sleeping for ${sleepy}s..."
sleep $sleepy
fi
done
else
echo "Could not start photon, the search index could not be found"
fi
#!/bin/bash
service postgresql start
/usr/sbin/apache2ctl -D FOREGROUND
## Set up nominatim updates ###
sudo -u nominatim ./src/build/utils/update.php --init-updates
sudo -u nominatim ./src/build/utils/update.php --import-osmosis-all &
## Follow log ###
tail -f /var/log/postgresql/postgresql-9.5-main.log
......@@ -3,26 +3,4 @@
### Start all containers ###
docker-compose down
docker-compose up -d
## Set up nominatim updates ###
docker exec -it photon-deploy_nominatim_1 sudo -u nominatim ./src/build/utils/update.php --init-updates
docker exec -it photon-deploy_nominatim_1 sudo -u nominatim ./src/build/utils/update.php --import-osmosis-all &
### Start continuous update ###
while true; do
starttime=$(date +%s)
curl http://localhost:2322/nominatim-update
# sleep a bit if updates take less than 5 minutes
endtime=$(date +%s)
elapsed=$((endtime - starttime))
if [[ $elapsed -lt 300 ]]; then
sleepy=$((300 - $elapsed))
echo "Sleeping for ${sleepy}s..."
sleep $sleepy
fi
done
docker-compose up -d
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment