From 37b0efb66a1e486e1c0f097df3d4ac124f4d8e15 Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Sun, 22 Sep 2019 03:54:44 +0100 Subject: [PATCH] postgres now needs building --- postgres/Dockerfile | 3 +++ postgres/setup.sh | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 postgres/Dockerfile create mode 100644 postgres/setup.sh diff --git a/postgres/Dockerfile b/postgres/Dockerfile new file mode 100644 index 0000000..d737976 --- /dev/null +++ b/postgres/Dockerfile @@ -0,0 +1,3 @@ +FROM postgres:latest +COPY postgres/setup.sh /docker-entrypoint-initdb.d/setup.sh +RUN chmod 0666 /docker-entrypoint-initdb.d/setup.sh diff --git a/postgres/setup.sh b/postgres/setup.sh new file mode 100644 index 0000000..d267955 --- /dev/null +++ b/postgres/setup.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +set -e + +sed -i "/host all all all/d" "$PGDATA/pg_hba.conf" +echo "host replication $REPLICATION_USER all md5" >> "$PGDATA/pg_hba.conf" +echo "host all $WUBLOADER_USER all md5" >> "$PGDATA/pg_hba.conf" + +psql -v ON_ERROR_STOP=1 -U postgres <<-EOSQL + +CREATE USER $WUBLOADER_USER LOGIN PASSWORD '$WUBLOADER_PASSWORD'; +CREATE USER $REPLICATION_USER LOGIN REPLICATION PASSWORD '$REPLICATION_PASSWORD'; + +EOSQL + +cat >> ${PGDATA}/postgresql.conf <