I'm trying to connect to my local server. I have the following docker-compose.yaml and servers.json files. I think I'm making a mistake with my .pgpass. When the containers are up and running I can login to pgAdmin, and I can see the docker_postgres_group "group", but when I try to login I get the authentication error in the first screenshot below. Further below is how I've got my pgpass set up. I think this is where the problem is, but I could be wrong...
docker-compose.yaml
version: '3.8'
services:
db:
container_name: pg_container
image: postgres
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test_db
ports:
- "5432:5432"
pgadmin:
container_name: pgadmin4_container
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "5050:80"
volumes:
- ./servers.json:/pgadmin4/servers.json # preconfigured servers/connections
- ./pgpass:/pgpass # passwords for the connections in this file
servers.json
{
"Servers": {
"1": {
"Name": "docker_postgres",
"Group": "docker_postgres_group",
"Host": "host.docker.internal",
"Port": 15432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"PassFile": "/pgpass",
"SSLMode": "prefer"
}
}
}
.pgpass This is what's inside my pgpass file: host.docker.internal:15432:postgres:postgres:postgres
I've tried having the .pgpass file in the pgpass folder and outside.
And - I'm using postgres as the password to try to login to pgadmin.

