forked from OpenTransitTools-BonePile/pelias.dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peter_build.sh
executable file
·37 lines (30 loc) · 1.15 KB
/
peter_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
docker-compose kill;
docker-compose down;
rm -rf "${DATA_DIR}/elasticsearch/*";
# start elasticsearch if it's not already running
if ! [ $(curl --output /dev/null --silent --head --fail http://localhost:9200) ]; then
docker-compose up -d elasticsearch;
# wait for elasticsearch to start up
echo 'waiting for elasticsearch service to come up';
until $(curl --output /dev/null --silent --head --fail http://localhost:9200); do
printf '.'
sleep 2
done
fi
# create the index in elasticsearch before importing data
docker-compose run -T --rm schema node scripts/drop_index.js --force-yes;
docker-compose run -T --rm schema npm run create_index;
# assuming elasticsearch is already running
# run ES importers
docker-compose run -T --rm openaddresses npm start;
docker-compose run -T --rm openstreetmap npm start;
docker-compose run -T --rm polylines npm start;
docker-compose run -T --rm transit npm start;
# start the containers
# note: the -d flag will background the logs
docker-compose up -d libpostal;
docker-compose up -d placeholder;
docker-compose up -d pip;
docker-compose up -d interpolation;
docker-compose up -d api;