Override pg_hba.conf using a custom file
This commit is contained in:
+3
-9
@@ -6,20 +6,14 @@ services:
|
|||||||
POSTGRES_USER: admin
|
POSTGRES_USER: admin
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: password
|
||||||
POSTGRES_DB: sop_monitoring
|
POSTGRES_DB: sop_monitoring
|
||||||
FORCE_RESTART: 3
|
FORCE_RESTART: 4
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
|
command: ["postgres", "-c", "hba_file=/etc/postgresql/pg_hba.conf"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./db:/docker-entrypoint-initdb.d
|
- ./db:/docker-entrypoint-initdb.d
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
- ./pg_hba.conf:/etc/postgresql/pg_hba.conf
|
||||||
db_fixer:
|
|
||||||
image: alpine
|
|
||||||
restart: "no"
|
|
||||||
volumes:
|
|
||||||
- pgdata:/var/lib/postgresql/data
|
|
||||||
command: >
|
|
||||||
sh -c "find /var/lib/postgresql/data -name pg_hba.conf -exec sh -c 'echo \"local all all trust\" > \"$1\"; echo \"host all all 127.0.0.1/32 trust\" >> \"$1\"; echo \"host all all ::1/128 trust\" >> \"$1\"; echo \"host all all all md5\" >> \"$1\"; echo \"host all all all scram-sha-256\" >> \"$1\"' _ {} \;"
|
|
||||||
|
|
||||||
|
|
||||||
api:
|
api:
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
local all all trust
|
||||||
|
host all all 127.0.0.1/32 trust
|
||||||
|
host all all ::1/128 trust
|
||||||
|
host all all all md5
|
||||||
|
host all all all scram-sha-256
|
||||||
Reference in New Issue
Block a user