8000 Docker: Add pgAudit · suryatmodulus/postgres@63d368c · GitHub
[go: up one dir, main page]

Skip to content

Commit 63d368c

Browse files
committed
Docker: Add pgAudit
1 parent 0683793 commit 63d368c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docker/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ RUN git clone git://github.com/theory/pgtap.git \
2323
RUN apt-get update \
2424
&& apt-get install postgresql-plpython3-12 -y
2525

26+
# install pgAudit
27+
RUN pgAuditDependencies="postgresql-server-dev-$PG_MAJOR \
28+
libssl-dev \
29+
libkrb5-dev \
30+
git-core" \
31+
&& apt-get update \
32+
&& apt-get install -y --no-install-recommends ${pgAuditDependencies} \
33+
&& cd /tmp \
34+
&& git clone https://github.com/pgaudit/pgaudit.git \
35+
&& cd pgaudit \
36+
&& git checkout master \
37+
&& make check USE_PGXS=1 \
38+
&& make install USE_PGXS=1
39+
2640
# install plv8
2741
ENV PLV8_VERSION=r3.0alpha
2842

docker/mnt/init-permissions.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
set -e
33

44
echo "host replication $POSTGRES_USER 0.0.0.0/0 trust" >> $PGDATA/pg_hba.conf
5-
echo "shared_preload_libraries = 'pg_stat_statements'" >> $PGDATA/postgresql.conf
5+
echo "shared_preload_libraries = 'pg_stat_statements, pgaudit'" >> $PGDATA/postgresql.conf
66
echo "pg_stat_statements.max = 10000" >> $PGDATA/postgresql.conf
77
echo "pg_stat_statements.track = all" >> $PGDATA/postgresql.conf
88
echo "wal_level=logical" >> $PGDATA/postgresql.conf
99
echo "max_replication_slots=5" >> $PGDATA/postgresql.conf
1010
echo "max_wal_senders=10" >> $PGDATA/postgresql.conf
11+
echo "log_destination='csvlog'" >> $PGDATA/postgresql.conf
12+
echo "logging_collector=on" >> $PGDATA/postgresql.conf
13+
echo "log_filename='postgresql.log'" >> $PGDATA/postgresql.conf
14+
echo "log_rotation_age=0" >> $PGDATA/postgresql.conf
15+
echo "log_rotation_size=0" >> $PGDATA/postgresql.conf

0 commit comments

Comments
 (0)
0