you can not use 'localhost' when pgadmin is run from a docker container no matter the docker network mode. For host mode use 'host.docker.internal'