volume is in pgbase

This commit is contained in:
f 2019-09-24 14:29:43 -03:00
parent 747ed5a2cc
commit f6848d58d8
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 4 additions and 3 deletions

View file

@ -6,7 +6,8 @@ RUN apk add --no-cache daemonize
FROM sutty/monit:latest 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 LANG en_US.utf8
ENV PGUSER sutty ENV PGUSER sutty
ENV PGDB sutty ENV PGDB sutty
@ -21,4 +22,4 @@ COPY ./monit.conf /etc/monit.d/postgresql.conf
RUN chmod 750 /usr/local/bin/postgresql RUN chmod 750 /usr/local/bin/postgresql
EXPOSE 5432 EXPOSE 5432
VOLUME $PGDATA VOLUME $PGBASE

View file

@ -10,7 +10,7 @@ case $1 in
log=${PGDATA}/postgresql.log log=${PGDATA}/postgresql.log
install -dm 2750 -o postgres -g postgres /run/postgresql 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 if test ! -f ${PGDATA}/PG_VERSION ; then
su - postgres -c "/usr/bin/initdb --locale ${LANG} -E UTF8 -D ${PGDATA}" su - postgres -c "/usr/bin/initdb --locale ${LANG} -E UTF8 -D ${PGDATA}"