I used flask_mongoengine to connect to the db as follows:
app.config['MONGODB_SETTINGS'] = {
'host': 'mongodb://mongo:27017/db_name'
}
mongo is the name of the container, but i am getting the following error:
"pymongo.errors.ServerSelectionTimeoutError: mongo:27017: [Errno -2] Name or service not known, Timeout: 30s, Topology Description: <TopologyDescription id: 605cb104a9a518d390b9ba99, topology_type: Single, servers: [<ServerDescription ('mongo', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('mongo:27017: [Errno -2] Name or service not known',)>]>"
docker-compose?Dockerfile? Both? Share us them.