Skip to content

Commit ce329c8

Browse files
sweatybridgedarora
authored andcommittedJun 6, 2023
fix: make pgdata real optional
1 parent 2953694 commit ce329c8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎docker/all-in-one/entrypoint.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,19 @@ fi
119119

120120
# Update pgdata directory
121121
if [ "${PGDATA_REAL:-}" ]; then
122-
mkdir -p "${PGDATA_REAL}"
123-
chown -R postgres:postgres "${PGDATA_REAL}"
122+
mkdir -p "${PGDATA_REAL}"
123+
chown -R postgres:postgres "${PGDATA_REAL}"
124124
fi
125125

126126
if [ "${PGDATA:-}" ]; then
127+
if [ "${PGDATA_REAL:-}" ]; then
127128
mkdir -p "$(dirname "${PGDATA}")"
128-
if [ "${PGDATA_REAL:-}" ]; then
129-
ln -s "${PGDATA}" "${PGDATA_REAL}"
130-
fi
129+
ln -s "${PGDATA}" "${PGDATA_REAL}"
130+
else
131+
mkdir -p "$PGDATA"
131132
chown postgres:postgres "$PGDATA"
132-
sed -i "s|data_directory = '.*'|data_directory = '$PGDATA'|g" $PG_CONF
133+
fi
134+
sed -i "s|data_directory = '.*'|data_directory = '$PGDATA'|g" $PG_CONF
133135
fi
134136

135137
# Download and extract init payload from s3

0 commit comments

Comments
 (0)
Please sign in to comment.