Estou tentando fazer a conexão via Docker compose no node, porem está dando erro
Docker-compose
version: "3.3"
services:
pgsql:
image: postgres:alpine
ports:
- '5432:5432'
container_name: 'pgsql'
restart: always
volumes:
- pg-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: pguser
POSTGRES_PASSWORD: pgpassword
adminer:
image: adminer
restart: always
ports:
- 8080:8080
api:
depends_on:
- pgsql
container_name: nestjs
image: nestjs-dev
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
env_file: ./.env
ports:
- $NODE_LOCAL_PORT:$NODE_LOCAL_PORT
environment:
- DATABASE_URL=$DATABASE_URL
stdin_open: true
tty: true
volumes:
- .:/app
- /app/node_modules
networks:
- orderSystem
volumes:
pg-data:
networks:
orderSystem:
driver: bridge
.env
NODE_LOCAL_PORT=3000
DATABASE_URL= postgres://pguser:pgpassword@pgsql:3000/nestjs