Skip to content

Commit e0bac86

Browse files
committed
add setup for pgrouting
1 parent b23f9ee commit e0bac86

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN chmod +x /docker-entrypoint-initdb.d/setup-0-pgaudit.sh \
4040
/docker-entrypoint-initdb.d/setup-3-pg_repack.sh \
4141
/docker-entrypoint-initdb.d/setup-4-pgstatstatements.sh \
4242
/docker-entrypoint-initdb.d/setup-5-pmm.sh \
43+
/docker-entrypoint-initdb.d/setup-6-pgrouting.sh \
4344
/docker-entrypoint-initdb.d/setup-dbs.sh \
4445
/usr/local/bin/setup-parse-index.sh
4546

scripts/setup-0-pgaudit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EOF
88

99
set -e
1010
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
11+
\c template1;
1112
CREATE EXTENSION pgaudit;
1213
ALTER SYSTEM SET pgaudit.log_catalog = off;
1314
ALTER SYSTEM SET pgaudit.log = 'all, -misc';

scripts/setup-3-pg_repack.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
set -e
44
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
5+
\c template1;
56
CREATE EXTENSION pg_repack;
67
EOSQL
78

scripts/setup-4-pgstatstatements.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ track_io_timing = on # Capture read/write stats
77
EOF
88

99
set -e
10-
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "postgres" <<-EOSQL
10+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
1111
CREATE EXTENSION pg_stat_statements SCHEMA public;
1212
ALTER SYSTEM SET shared_preload_libraries = 'set-user, pg_stat_statements';
1313
EOSQL

scripts/setup-6-pgrouting.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -e
4+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
5+
\c template1;
6+
CREATE EXTENSION pgrouting;
7+
EOSQL
8+
9+
exec "$@"

scripts/setup-dbs.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER}" --dbname "${POSTGRES_DB}"
55
CREATE USER ${PG_PARSE_USER} LOGIN CONNECTION LIMIT 100 ENCRYPTED PASSWORD '${PG_PARSE_PASSWORD}';
66
CREATE DATABASE ${PG_PARSE_DB} OWNER ${PG_PARSE_USER};
77
\c ${PG_PARSE_DB};
8-
CREATE EXTENSION postgis;
9-
CREATE EXTENSION postgis_topology;
10-
CREATE EXTENSION pg_repack;
8+
CREATE EXTENSION IF NOT EXISTS postgis;
9+
CREATE EXTENSION IF NOT EXISTS postgis_topology;
1110
EOSQL
1211

1312
exec "$@"

0 commit comments

Comments
 (0)