Using pgadmin in docker via compose

From: Tim Uckun <timuckun(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Using pgadmin in docker via compose
Date: 2023-05-17 10:01:30
Message-ID: CAGuHJrM=dnQ4rjwd2EWTvSDZThfqgqdDRrd1yXJtebMi-z+40A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-admin

Hi.

I want to set up pgadmin in a docker compose and have it automatically
be able to connect to the database running in the same compose file.

I have set up the following entry in the compose file (excuse the indents)

pgadmin:
image: dpage/pgadmin4:latest
volumes:
- ./pgadmin_servers.json:/pgadmin4/servers.json
- ./pgpass:/pgadmin4/.pgpass:ro
ports:
- 5050:5050
environment:
PGADMIN_DEFAULT_EMAIL: timuckun(at)gmail(dot)com
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_LISTEN_PORT: 5050
PGADMIN_SERVER_JSON_FILE: /pgadmin4/servers.json

This is the servers file

{
"Servers": {
"1": {
"Name": "Minimally Defined Server",
"Group": "Server Group 1",
"Port": 5432,
"Username": "benchmarkdbuser",
"Host": "tfb-database",
"SSLMode": "prefer",
"MaintenanceDB": "hello_world",
"PassFile": "/pgadmin4/.pgpass"
}
}
}

This launched the pgadmin app but the server doesn't show up in the list.

I am wondering what I need to do in order to make this happen. Ideally
the app would also log in as admin and go right to the startup screen.

Thanks.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Yogesh Mahajan 2023-05-17 10:38:51 Re: Using pgadmin in docker via compose
Previous Message Aditya Toshniwal 2023-05-17 05:52:55 Re: Help with running pgadmin in a docker container

Browse pgsql-admin by date

  From Date Subject
Next Message Yogesh Mahajan 2023-05-17 10:38:51 Re: Using pgadmin in docker via compose
Previous Message Laurenz Albe 2023-05-17 06:10:08 Re: ERROR: could not serialize access due to concurrent update