Export vars to fix the postgres container error

This commit is contained in:
Pan Luo 2017-01-30 15:57:17 -08:00
parent 5c9589dae0
commit 4c30235fde
No known key found for this signature in database
GPG Key ID: AD11D35AAC25FB6A

View File

@ -4,12 +4,18 @@
: ${WAL_LEVEL:=minimal} : ${WAL_LEVEL:=minimal}
: ${ARCHIVE_MODE:=off} : ${ARCHIVE_MODE:=off}
: ${ARCHIVE_TIMEOUT:=60} : ${ARCHIVE_TIMEOUT:=60}
export WAL_LEVEL
export ARCHIVE_MODE
export ARCHIVE_TIMEOUT
# PGDATA is defined in upstream postgres dockerfile # PGDATA is defined in upstream postgres dockerfile
function update_conf () { function update_conf () {
if [ -f $PGDATA/postgresql.conf ]; then if [ -f $PGDATA/postgresql.conf ]; then
sed -i "s/wal_level =.*$/wal_level = $WAL_LEVEL/g" $PGDATA/postgresql.conf sed -i "s/wal_level =.*$/wal_level = $WAL_LEVEL/g" $PGDATA/postgresql.conf
sed -i "s/archive_mode =.*$/archive_mode = $ARCHIVE_MODE/g" $PGDATA/postgresql.conf sed -i "s/archive_mode =.*$/archive_mode = $ARCHIVE_MODE/g" $PGDATA/postgresql.conf
sed -i "s/archive_timeout =.*$/archive_timeout = $ARCHIVE_TIMEOUT/g" $PGDATA/postgresql.conf
fi fi
} }