Skip to content

Commit 0c58510

Browse files
committed
fix db setup for cron
1 parent cb94645 commit 0c58510

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ RUN chmod +x /docker-entrypoint-initdb.d/setup-0-pgaudit.sh \
4848
/usr/local/bin/setup-parse-index.sh
4949

5050
USER postgres
51-
CMD ["postgres", "-c", "shared_preload_libraries=pgaudit"]
51+
CMD ["postgres", "-c", "shared_preload_libraries=pg_stat_statements,pgaudit,pg_cron"]

scripts/setup-4-pgstatstatements.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ EOF
99
set -e
1010
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
1111
CREATE EXTENSION pg_stat_statements SCHEMA public;
12-
ALTER SYSTEM SET shared_preload_libraries = 'set-user, pg_stat_statements';
1312
EOSQL
1413

1514
exec "$@"

scripts/setup-dbs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/bin/bash
22

3+
cat >> ${PGDATA}/postgresql.conf <<EOF
4+
cron.database_name = '$POSTGRES_DB'
5+
shared_preload_libraries = 'set-user, pg_stat_statements, pgaudit, pg_cron'
6+
EOF
7+
38
set -e
49
psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" <<-EOSQL
510
CREATE USER ${PG_PARSE_USER} LOGIN CONNECTION LIMIT 100 ENCRYPTED PASSWORD '${PG_PARSE_PASSWORD}';
611
CREATE DATABASE ${PG_PARSE_DB} OWNER ${PG_PARSE_USER};
12+
CREATE EXTENSION pg_cron;
713
\c ${PG_PARSE_DB};
814
CREATE EXTENSION IF NOT EXISTS postgis;
915
CREATE EXTENSION IF NOT EXISTS postgis_topology;

0 commit comments

Comments
 (0)