fix postgres build

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-06-15 15:42:26 +02:00
parent adba1d645f
commit 051f202fdf
2 changed files with 5 additions and 4 deletions

View file

@ -27,10 +27,6 @@ RUN set -ex; \
mkdir /mnt/data; \
chown postgres:postgres /mnt/data; \
\
# Modify conf
grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; \
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf; \
\
# Give root a random password
echo "root:$(openssl rand -base64 12)" | chpasswd; \
apk --no-cache del openssl;

View file

@ -153,6 +153,11 @@ if [ -n "$MAX_CONNECTIONS" ]; then
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
fi
# Modify conf
if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf
fi
# Catch docker stop attempts
trap 'true' SIGINT SIGTERM