pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

server is not listed in the admin UI by default docker-compose through environment variables

Open nagkumar opened this issue 9 months ago • 3 comments

services:
    postgres:
        container_name: postgres
        image: postgres:15.2-alpine
        environment:
            - POSTGRES_USER=postgres
            - POSTGRES_PASSWORD=postgres
            - POSTGRES_DB=postgres
        ports:
            - "15432:5432"
        restart: unless-stopped

    pgadmin:
        container_name: pgadmin
        image: dpage/pgadmin4
        restart: always
        environment:
            PGHOST: postgres
            PGADMIN_DEFAULT_EMAIL: [email protected]
            PGADMIN_DEFAULT_USER: postgres
            PGADMIN_DEFAULT_PASSWORD: postgres
            PGADMIN_DEFAULT_DB: postgres

        ports:
            - "5050:80"

PGAdmin UI does not list the postgress server.. though PGHOST value is given in pgadmin config.. it is better pgadmin support auto configure container db automatically

image

nagkumar avatar May 08 '24 14:05 nagkumar

Tried with other environment variables too that also does not help..

e.g


      PGADMIN_SERVER_MODE: "True"
      PGADMIN_DEFAULT_SERVER: postgres
      POSTGRES_DB_SERVER_HOST: postgres
      POSTGRES_DB_SERVER_PORT: 5432
      POSTGRES_DB_SERVER_MAINTENANCE_DATABASE: postgres
      POSTGRES_DB_SERVER_USERNAME: postgres
      POSTGRES_DB_SERVER_PASSWORD: postgres

nagkumar avatar May 08 '24 14:05 nagkumar

@nagkumar To load servers to pgadmin , you need to specify server details in the json file and need to pass/map file path to environment variable of pgadmin service. Please refer to this link. or you can add server from UI.

yogeshmahajan-1903 avatar May 09 '24 05:05 yogeshmahajan-1903

pass/map file path to environment variable of pgadmin service

instead of file approach looking for special environment variable that I can define as part of pgadmin install to make this automatic. Is that possible.. if not wish that feature come in..

server from UI I want to avoid this step let docker-compose do that for me

nagkumar avatar May 09 '24 09:05 nagkumar

We are not planning to implement this.

khushboovashi avatar May 17 '24 10:05 khushboovashi

any reason for not seeing the priority..

In the micro services world trying to configure each admin manually can be truly painful and error prone, pgadmin can't be without postgre server.. wish some importance given to automate smartly

nagkumar avatar May 17 '24 11:05 nagkumar