Robustly generate pg_hba.conf in /tmp during startup
This commit is contained in:
+9
-2
@@ -9,11 +9,18 @@ services:
|
||||
FORCE_RESTART: 4
|
||||
ports:
|
||||
- "5432:5432"
|
||||
command: ["postgres", "-c", "hba_file=/etc/postgresql/pg_hba.conf"]
|
||||
entrypoint: /bin/sh
|
||||
command: >
|
||||
-c "
|
||||
echo 'local all all trust' > /tmp/pg_hba.conf;
|
||||
echo 'host all all 0.0.0.0/0 md5' >> /tmp/pg_hba.conf;
|
||||
echo 'host all all 0.0.0.0/0 scram-sha-256' >> /tmp/pg_hba.conf;
|
||||
chown postgres:postgres /tmp/pg_hba.conf || true;
|
||||
exec /usr/local/bin/docker-entrypoint.sh postgres -c hba_file=/tmp/pg_hba.conf
|
||||
"
|
||||
volumes:
|
||||
- ./db:/docker-entrypoint-initdb.d
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
- ./pg_hba.conf:/etc/postgresql/pg_hba.conf
|
||||
|
||||
|
||||
api:
|
||||
|
||||
Reference in New Issue
Block a user