I have created an ubuntu image with nginx, php and postgres.
I want to connect the postgres database in my current image with pgadmin located on my loca
In my case, I had a PostgreSQL container, so I didn't change my container or create a docker-compose approach, I needed pgadming after few months to had installed PostgreSQL, so this is my approach:
docker inspect my_container_id_postgreSQLThe network assigned to PostgreSQL was:
"Networks": { "docker_default": { "IPAddress": "172.18.0.2", ... } }
Ran my PGADMIN with --network command.
docker run -p 85:80 --network docker_default -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' -d dpage/pgadmin4
Insert the Ip address into pgAdmin and the database credentials used in docker.
I hope this can be useful for someone. Regards.