Run Talk,Redis,Mongo in different docker container


Hi all,

I´m trying to not use the existing docker-compose file but running three different docker instances:

docker run --name redisdocker -p -d redis

docker run --name mongodocker -p -d mongo

docker run -d -t -i -e NODE_ENV='development' -e TALK_MONGO_URL='mongodb://' -e TALK_REDIS_URL='redis://' -e TALK_ROOT_URL='' -e TALK_PORT='3000' -e TALK_JWT_SECRET='password' -p 3000:3000 --name talkdocker coralproject/talk

Checking the logs (docker logs talkdocker) shows that talk is not able to connect to the mongodb.

{ MongoError: failed to connect to server [] on first connect [MongoError: connect ECONNREFUSED]

I know it is more a docker question then talk question, but maybe someone can support here.

Many thanks in advance.


Problem solved. Using the docker container IP (use docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
to get the IP) seems to solve the problem.
Can be closed.


Great, thanks Simon!