Olá! Quando eu dou o comando docker compose up, eu recebo o seguinte erro:
alurabooks | Server initialiazed on port 3000
alurabooks |
alurabooks | Mongoose! Disconnected from mongodb://meu-mongo:27017/alura-books
alurabooks |
alurabooks | Mongoose! Connection error: MongoError: failed to connect to server [meu-mongo:27017] on first connect [MongoError: connect ECONNREFUSED 172.19.0.2:27017]
alurabooks | (node:22) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MongoError: failed to connect to server [meu-mongo:27017] on first connect [MongoError: connect ECONNREFUSED 172.19.0.2:27017]
Segue o docker-compose.yml:
version: "3.9"
services:
mongodb:
image: mongo:4.4.6
container_name: meu-mongo
networks:
- compose-bridge
alurabooks:
image: aluradocker/alura-books:1.0
container_name: alurabooks
networks:
- compose-bridge
ports:
- 3000:3000
depends_on:
- mongodb
networks:
compose-bridge:
driver: bridge