-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-entrypoint.sh
47 lines (40 loc) · 1.38 KB
/
docker-entrypoint.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
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#export CONTINENT=europe
#export MAP=netherlands-latest
#export MAP=malta-latest
if [ ! -f ${MAP}.osm.pbf ]
then
echo "Building for "${CONTINENT}"/"${MAP}
wget https://download.geofabrik.de/${CONTINENT}/${MAP}.osm.pbf -O ${MAP}.osm.pbf
## Truck
echo ">>>>>>> Truck"
mkdir truck && cd truck && cp ../${MAP}.osm.pbf .
osrm-extract ${MAP}.osm.pbf -p ../truck.lua && osrm-contract ${MAP}.osrm
## Add Car
# nano /profiles/car.lua
echo ">>>>>>> Car"
cd .. && mkdir car && cd car && cp ../${MAP}.osm.pbf .
osrm-extract ${MAP}.osm.pbf -p ../car.lua && osrm-contract ${MAP}.osrm
# NOTE: van profile currently not active
# ## Add Van
#echo ">>>>>>> Van"
#cd .. && mkdir van && cd van && cp ../${MAP}.osm.pbf .
#osrm-extract ${MAP}.osm.pbf -p ../van.lua && osrm-contract ${MAP}.osrm
#osrm-routed ${MAP}.osm.pbf -p 5002 --max-table-size 500 &
## Add Cargo Bike
echo ">>>>>>> Bike"
cd .. && mkdir bike && cd bike && cp ../${MAP}.osm.pbf .
osrm-extract ${MAP}.osm.pbf -p ../bike.lua && osrm-contract ${MAP}.osrm
cd ..
fi
echo "Starting services "${CONTINENT}"/"${MAP}
cd truck
osrm-routed ${MAP}.osm.pbf -p 5000 --max-table-size 500 &
cd ../car
osrm-routed ${MAP}.osm.pbf -p 5001 --max-table-size 500 &
# cd ../van
# osrm-routed ${MAP}.osm.pbf -p 5002 --max-table-size 500 &
cd ../bike
osrm-routed ${MAP}.osm.pbf -p 5003 --max-table-size 500 &
child=$!
wait "$child"