commit | author | age
|
d1e1f5
|
1 |
#!/bin/bash |
JK |
2 |
|
|
3 |
. common.sh |
|
4 |
|
|
5 |
DOCKER_IMAGE=debian:buster |
|
6 |
DOCKER_NAME="${DOCKER_PREFIX}-data" |
|
7 |
|
|
8 |
DATA_FILENAME=`basename "${DATA_URL}"` |
|
9 |
|
|
10 |
docker pull "${DOCKER_IMAGE}" |
|
11 |
|
|
12 |
docker rm -v "${DOCKER_NAME}" |
|
13 |
docker run -i -t -d \ |
|
14 |
--link "${DOCKER_PREFIX}-postgis:postgres" \ |
|
15 |
-v "${HOST_DATA_DIR}:/srv/pbf" \ |
|
16 |
-v "${HOST_CARTO_DIR}:/srv/carto" \ |
|
17 |
--name "${DOCKER_NAME}" \ |
|
18 |
"${DOCKER_IMAGE}" |
|
19 |
|
|
20 |
docker exec -i -t "${DOCKER_NAME}" bash -c "apt-get update && apt-get -y install --no-install-recommends --no-install-suggests osm2pgsql wget" |
|
21 |
docker exec -i -t "${DOCKER_NAME}" bash -c "cd /srv/pbf && wget -N ${DATA_URL}" |
|
22 |
docker exec -i -t "${DOCKER_NAME}" bash -c "cd /srv/pbf && PGPASSWORD=${POSTGRES_PASSWORD} osm2pgsql --slim --hstore --cache ${DATA_MEM_MB} --number-processes ${DATA_CPU_CORES} --host postgres --username ${POSTGRES_USER} --database ${POSTGRES_USER} --style /srv/carto/repo/openstreetmap-carto.style --tag-transform-script /srv/carto/repo/openstreetmap-carto.lua /srv/pbf/${DATA_FILENAME}" |
|
23 |
|
|
24 |
docker stop "${DOCKER_NAME}" |