I'm trying to configure my docker to pgadmin4 in my nest js project, to do the backend, but when i try connect, show this message "Unable to connect to server:
could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting"
I already tried configure the docker-compose.yml with pgadmin configurations, network configurations and
my docker-compose.yml
version: '3'
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: "12345678"
ports:
- "5432:5432"
volumes:
- ./data/pgadmin/
networks:
- pg-network
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: "[email protected]"
PGADMIN_DEFAULT_PASSWORD: "abc"
ports:
- "5050:80"
depends_on:
- db
networks:
- pg-network
networks:
pg-network:
driver: bridge
My actual result is connection refused is server running on host "localhost (127.0.0.1) and accepting" but i expect he open the pgadmin to create the database
postgres
image from Docker Hub? – richyenvolumes
section might fix it for you – richyen