“This is my configuration within docker-compose.yaml:
version: "3.8"
services:
nestapp:
build: ./
ports:
- "3000:3000"
env_file:
- .development.env
depends_on:
- postgresdb
postgresdb:
image: 'postgres'
volumes:
- pgdata:/var/lib/postgresql/data
env_file:
- .development.env
volumes:
pgdata:
docker-compose.yml
In the environment variables, I only have POSTGRES_PASSWORD= root and POSTGRES_DB = root.
Now, I start the container with ‘docker compose up’ and then I go to pgadmin where I register a new server. I enter the IP address that I’m obtaining from the container in the inspect section, port: 5432, maintenance database: e-commerce, username: postgres, and password: root. However, it ends up showing the error: ‘Unable to connect to server: connection timeout expired.
pgadmin register-server
Does anyone know how I can fix this?
I tried reinstalling PostgreSQL since I saw in other posts that this could work, but nothing.”
Juan Carlos Alvarez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1