volume is in pgbase
This commit is contained in:
parent
747ed5a2cc
commit
f6848d58d8
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue