From f6848d58d86c4f3a8b252816f68a9a7bf4218089 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 24 Sep 2019 14:29:43 -0300 Subject: [PATCH] volume is in pgbase --- Dockerfile | 5 +++-- postgresql.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 90609e8..c9ce83b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ RUN apk add --no-cache daemonize FROM sutty/monit:latest -ENV PGDATA /var/lib/postgresql/11/data +ENV PGBASE /var/lib/postgresql +ENV PGDATA $PGBASE/11/data ENV LANG en_US.utf8 ENV PGUSER sutty ENV PGDB sutty @@ -21,4 +22,4 @@ COPY ./monit.conf /etc/monit.d/postgresql.conf RUN chmod 750 /usr/local/bin/postgresql EXPOSE 5432 -VOLUME $PGDATA +VOLUME $PGBASE diff --git a/postgresql.sh b/postgresql.sh index fc292e1..06c67e9 100644 --- a/postgresql.sh +++ b/postgresql.sh @@ -10,7 +10,7 @@ case $1 in log=${PGDATA}/postgresql.log install -dm 2750 -o postgres -g postgres /run/postgresql - chown -R postgres:postgres /var/lib/postgresql + chown -R postgres:postgres ${PGBASE} if test ! -f ${PGDATA}/PG_VERSION ; then su - postgres -c "/usr/bin/initdb --locale ${LANG} -E UTF8 -D ${PGDATA}"