Cannot connect to Docker Postgres DB on second computer

I have a postgres database sitting in docker I am developing on two seperate computers, Notebook and Desktop. On Desktop everything works but on my Notebook I cannot authenticate to the DB This is the docker-compose.yml file.
version: '3.8'

services:
postgres:
image: postgres:latest
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_USER}
POSTGRES_DB: ${DB}
volumes:
- db_data:/var/lib/postgresql/data
ports:
- ${DB_PORTS}

volumes:
db_data: {}
version: '3.8'

services:
postgres:
image: postgres:latest
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_USER}
POSTGRES_DB: ${DB}
volumes:
- db_data:/var/lib/postgresql/data
ports:
- ${DB_PORTS}

volumes:
db_data: {}
I have this config in my .env file
#Docker
DATABASE_USER="postgres"
DATABASE_PASSWORD="admin"
DB="db"
DB_PORTS="5432:5432"

# Prisma
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DATABASE_URL="postgres://postgres:admin@127.0.0.1:5432/db"
#Docker
DATABASE_USER="postgres"
DATABASE_PASSWORD="admin"
DB="db"
DB_PORTS="5432:5432"

# Prisma
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DATABASE_URL="postgres://postgres:admin@127.0.0.1:5432/db"
Does anyone know why I can't connect to the DB on Notebook?
0 Replies
No replies yetBe the first to reply to this messageJoin