Connection issues with MongoDB in Docker (with compose)

Hi! So, I’ve built a microservice-based application in express.js using mongoose. I want to deploy that to my VPS using docker compose, however I’m having connection issues. I’ve linked a GitHub gist with the error and my docker-compose.yml.
I can provide more context if needed.

Check this link.It may help

Mongodb docker is not working

Post says the container is likely not running, however that’s not my case. For me, I see it’s running and if I check the logs there are no traces of attempted connections from the microservices. I can also connect to it using Compass (probably should’ve mentioned that).

Alright so the issue was that my auto-generated password contained @ and wasn’t escaped, which made mongoose think it’s the DB host. I solved it by changing my password to one that doesn’t contain special characters.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.