commit | author | age
|
d1e1f5
|
1 |
#!/bin/bash |
JK |
2 |
|
|
3 |
. common.sh |
|
4 |
|
|
5 |
DOCKER_IMAGE=postgis/postgis:12-3.0 |
|
6 |
DOCKER_NAME="${DOCKER_PREFIX}-postgis" |
|
7 |
|
|
8 |
docker pull "${DOCKER_IMAGE}" |
|
9 |
docker stop "${DOCKER_NAME}" > /dev/null 2>&1 |
|
10 |
docker rm -v "${DOCKER_NAME}" |
|
11 |
docker run -d \ |
|
12 |
-v "${HOST_POSTGRES_DIR}:/var/lib/postgresql/data" \ |
|
13 |
-e "POSTGRES_USER=${POSTGRES_USER}" \ |
|
14 |
-e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" \ |
|
15 |
--name "${DOCKER_NAME}" \ |
|
16 |
"${DOCKER_IMAGE}" \ |
|
17 |
${PG_OPTIONS} |
|
18 |
|
|
19 |
sleep 2 |
|
20 |
echo 'CREATE EXTENSION IF NOT EXISTS hstore;' | docker exec -i --user postgres "${DOCKER_NAME}" psql --dbname="${POSTGRES_USER}" |