Closed HerryLo closed 5 years ago
Looks like your Node container is trying to connect to Mongo while it's still initializing and before it's started accepting connections
node_1 | connection error: { MongoNetworkError: failed to connect to server [172.18.0.2:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 172.18.0.2:27017] . . . mongo_1 | 2019-01-24T02:41:32.655+0000 I NETWORK [initandlisten] waiting for connections on port 27017
In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow.
Dockerfile
config filedocker-compose.yml
文件cmd
But it's possible to connect mongodb locally.
npm run dev
connected true。There's a problem with node docker container connections.what???