Fix postgres pg_hba.conf via docker-compose

This commit is contained in:
2026-08-11 12:51:18 +05:30
parent d264e3f1cc
commit cdd8deeef5
2 changed files with 11 additions and 13 deletions
+9
View File
@@ -11,6 +11,15 @@ services:
volumes:
- ./db:/docker-entrypoint-initdb.d
- pgdata:/var/lib/postgresql/data
command: >
bash -c "
if [ -f /var/lib/postgresql/data/pg_hba.conf ]; then
sed -i 's/hostssl/host/g' /var/lib/postgresql/data/pg_hba.conf
echo 'host all all all md5' >> /var/lib/postgresql/data/pg_hba.conf
echo 'host all all all scram-sha-256' >> /var/lib/postgresql/data/pg_hba.conf
fi
exec docker-entrypoint.sh postgres
"
api:
build: ./api