From 07c8a4bb0701d82425d598510ee6077a4df1056d Mon Sep 17 00:00:00 2001 From: Leonid Tsarev Date: Thu, 11 Jan 2024 20:56:49 +0300 Subject: [PATCH] automatically configure pgadmin --- docker-compose.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 92cfae6..2d91d75 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,5 +37,30 @@ services: environment: PGADMIN_DEFAULT_EMAIL: admin@admin.com PGADMIN_DEFAULT_PASSWORD: root + PGADMIN_CONFIG_SERVER_MODE: 'False' + PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False' ports: - - "5050:80" \ No newline at end of file + - "5050:80" + entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;" + user: root + configs: + - source: servers.json + target: /pgadmin4/servers.json + - source: pgpass + target: /pgpass + +configs: + pgpass: + content: db:5432:*:kogdauser:kogdapass + servers.json: + content: | + {"Servers": {"1": { + "Group": "Servers", + "Name": "KogdaIgra Db", + "Host": "db", + "Port": 5432, + "MaintenanceDB": "kogdaigra", + "Username": "kogdauser", + "PassFile": "/pgpass", + "SSLMode": "prefer" + }}} \ No newline at end of file