Reputation: 632
This is my docker-compose.yml
services:
db:
container_name: postgres
image: postgres:latest
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test_db
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin123
ports:
- 8002:80
Pg-admin is running in port 8002
To connect pgsql with pgadmin I have used below credential to add new server in pgadmin, I am getting below error,
How do I will map this connection ?
In docker panel it's showing postgres is running
Upvotes: 0
Views: 185
Reputation: 16515
When you using more than one container and there are related, localhost not works.
Instead of localhost set the ip of the host in which your postgress is running.
Read these topics to understand ip vs localhost in docker
Upvotes: 1