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}"