-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReplicaSetNoPrimary MongooseServerSelectionError when connecting from inside a Docker container #52
Comments
I think your problem is because you are only opening port 3000, can you try changing |
I updated the run command to bind ports 27017, 27018, 27019 and also the EXPOSE directive in the Dockerfile but I still get the connection refused. |
I got mine running, try the following when you run the container: Hope this helps. |
I still get the same error. Note that when we use "host" network mode the published ports are discarded.
|
I'm facing the same issue, where client is disconnected arbitrarily saying MongooseServerSelectionError: connection timeout. |
Environment: MacOS
Issue:
I have a NodeJS application that I want to run inside a Docker container to connect to the replica set using mongoose 5.10.6. I start my replica set with
run-rs --dbpath ./data --keep
. When I run my application outside of a Docker containernode server
I connect successfully{"message":"Mongoose successfully connected to mongodb://localhost:27017,localhost:27018,localhost:27019/my-app-dev?replicaSet=rs","level":"info","service”:"my-ap"
However, when I run the application inside of a Docker container, I get the following errorHere is my Dockerfile
The text was updated successfully, but these errors were encountered: