79475632

Date: 2025-02-28 13:18:24
Score: 1
Natty:
Report link

Your setup looks correct. Connection string that you should use is:

mongodb://mongodb:27017

If you have still issues, please dobule check:

  1. Are you running your solution by docker-compose up ?? Only docker-compose will work since docker-compose creates network and DNS resolution between services.
  2. Is your mongodb service really running after docker-compose up? Are there any logs in this container? Maybe there is a problem with this container, it goes done and that's why database is unavailable.
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Kynes