I'm running a dockerised django app with db settings: docker compose file
I want to connect the db to pgadmin4, for that created a pgadmin4 container using
docker run -p 5555:80 --name pgadmin -e PGADMIN_DEFAULT_EMAIL='postgresdb' -e
PGADMIN_DEFAULT_PASSWORD='password' dpage/pgadmin4;
and logged in on chrome with <docker-machine ip>:5555
Initiated a new server there with
Host name/address: <ip of running db service> (attained using
docker inspect
on the running db container)port: 5432 (which is shown as the default port open for db service)
When trying to connect its delays for a second and shows this timeout error: "Unable to connect to server: timeout expired on docker"
Any workaround for this issue.
Although, I can connect using terminal with docker exec -it <container-id> bash
, is there any way I can connect using pgadmin4. I'm new to both docker and PostgreSQL.
(to check the issue, I've closed the django app and, initiated another postgres container manually using, docker run --name local-db -e POSTGRES_PASSWORD=incorrect -d -p 5432:5432 postgres:alpine
and try to connect to pgadmin4 using same way it connects successfully, but with the django server it fails..)