diff --git a/Dockerfile b/Dockerfile index 6c8b838..ee8e913 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ FROM postgres:17-bullseye -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1 -ENV POSTGRES_INITDB_ARGS "--data-checksums" +LABEL maintainer="HIPAA Postgres w/ PostGIS Project" \ + org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 17 bullseye" \ + org.opencontainers.image.source="https://github.com/netreconlab/hipaa-postgres/" + +ENV POSTGIS_MAJOR=3 +ENV POSTGIS_VERSION=3.5.0+dfsg-1.pgdg110+1 +ENV POSTGRES_INITDB_ARGS="--data-checksums" RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ @@ -17,6 +21,7 @@ RUN apt-get update \ postgresql-$PG_MAJOR-set-user \ postgresql-$PG_MAJOR-repack \ postgresql-$PG_MAJOR-cron \ + postgresql-$PG_MAJOR-pgrouting \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /docker-entrypoint-initdb.d @@ -43,4 +48,4 @@ RUN chmod +x /docker-entrypoint-initdb.d/setup-0-pgaudit.sh \ /usr/local/bin/setup-parse-index.sh USER postgres -CMD ["postgres", "-c", "shared_preload_libraries=pgaudit"] +CMD ["postgres", "-c", "shared_preload_libraries=pg_stat_statements,pgaudit,pg_cron"] diff --git a/Dockerfile.pgpool b/Dockerfile.pgpool index 2911031..ee80392 100644 --- a/Dockerfile.pgpool +++ b/Dockerfile.pgpool @@ -1,8 +1,12 @@ FROM postgres:17-bullseye -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1 -ENV POSTGRES_INITDB_ARGS "--data-checksums" +LABEL maintainer="HIPAA Postgres w/ PostGIS Project" \ + org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension and PGPool with PostgreSQL 17 bullseye" \ + org.opencontainers.image.source="https://github.com/netreconlab/hipaa-postgres/" + +ENV POSTGIS_MAJOR=3 +ENV POSTGIS_VERSION=3.5.0+dfsg-1.pgdg110+1 +ENV POSTGRES_INITDB_ARGS="--data-checksums" RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ @@ -20,6 +24,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR-pgaudit \ postgresql-$PG_MAJOR-set-user \ postgresql-$PG_MAJOR-repack \ + postgresql-$PG_MAJOR-cron \ + postgresql-$PG_MAJOR-pgrouting \ postgresql-$PG_MAJOR-pgpool2\ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /docker-entrypoint-initdb.d @@ -47,5 +53,5 @@ RUN chmod +x /docker-entrypoint-initdb.d/setup-0-pgaudit.sh \ /usr/local/bin/setup-parse-index.sh USER postgres -CMD ["postgres", "-c", "shared_preload_libraries=pgaudit"] +CMD ["postgres", "-c", "shared_preload_libraries=pg_stat_statements,pgaudit,pg_cron"] EXPOSE 22 diff --git a/scripts/setup-0-pgaudit.sh b/scripts/setup-0-pgaudit.sh index 9d02c79..d16fecb 100644 --- a/scripts/setup-0-pgaudit.sh +++ b/scripts/setup-0-pgaudit.sh @@ -8,12 +8,12 @@ EOF set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + \c template1; CREATE EXTENSION pgaudit; ALTER SYSTEM SET pgaudit.log_catalog = off; ALTER SYSTEM SET pgaudit.log = 'all, -misc'; ALTER SYSTEM SET pgaudit.log_relation = 'on'; ALTER SYSTEM SET pgaudit.log_parameter = 'on'; - ALTER SYSTEM SET shared_preload_libraries = 'set-user'; EOSQL exec "$@" diff --git a/scripts/setup-3-pg_repack.sh b/scripts/setup-3-pg_repack.sh index 3e492af..38618ff 100644 --- a/scripts/setup-3-pg_repack.sh +++ b/scripts/setup-3-pg_repack.sh @@ -2,6 +2,7 @@ set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + \c template1; CREATE EXTENSION pg_repack; EOSQL diff --git a/scripts/setup-4-pgstatstatements.sh b/scripts/setup-4-pgstatstatements.sh index edfce8d..b103e3f 100644 --- a/scripts/setup-4-pgstatstatements.sh +++ b/scripts/setup-4-pgstatstatements.sh @@ -7,9 +7,8 @@ track_io_timing = on # Capture read/write stats EOF set -e -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "postgres" <<-EOSQL +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE EXTENSION pg_stat_statements SCHEMA public; - ALTER SYSTEM SET shared_preload_libraries = 'set-user, pg_stat_statements'; EOSQL exec "$@" diff --git a/scripts/setup-dbs.sh b/scripts/setup-dbs.sh index 03c8aaf..f30d119 100644 --- a/scripts/setup-dbs.sh +++ b/scripts/setup-dbs.sh @@ -1,13 +1,19 @@ #!/bin/bash +cat >> ${PGDATA}/postgresql.conf <