17 lines
486 B
Bash
17 lines
486 B
Bash
#!/bin/sh
|
|
# This is based on https://github.com/postgis/docker-postgis/blob/4eb614133d6aa87bfc5c952d24b7eb1f499e5c7c/12-3.0/initdb-postgis.sh
|
|
set -e
|
|
|
|
# Perform all actions as $POSTGRES_USER
|
|
export PGUSER="$POSTGRES_USER"
|
|
|
|
for DB in template1 "$POSTGRES_DB"; do
|
|
echo "Loading extensions into $DB"
|
|
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
|
|
CREATE EXTENSION IF NOT EXISTS citext;
|
|
CREATE EXTENSION IF NOT EXISTS btree_gist;
|
|
EOSQL
|
|
done
|
|
|
|
/docker-entrypoint.sh "$@"
|