I am facing problem using docker-compose to link a django container with postgres and mongo containers? I am trying to use \"docker-compose up\" which starts up the mongo and po
You should specify host name like in the docker compose file, instead of IP address.
I've faced similar problems in connecting from a Tornado Web app to Mongo DB. Here is my docker-compose.yml:
web:
build: .
ports:
- "8888:8888"
volumes:
- .:/code
links:
- db
db:
image: mongo:3.0
Here is my connection string:
motorengine.connect("db", host='db', port=27017, io_loop=io_loop)
My error was to specify IP address instead of host name (db) like in the docker compose file.