adminMongo icon indicating copy to clipboard operation
adminMongo copied to clipboard

Issue with docker-compose

Open thomasd3 opened this issue 7 years ago • 2 comments

I am trying to get adminMongo to connect to the mongo instance from the same docker compose. that instance is not visible from the outside, so entering the ip/port for the connection in the UI doesn't make any sense.

I tried to add:

     environment:
       CONN_NAME: test
       DB_HOST: mongodb. // name of the mongo container
       DB_PORT: 27017

but it doesn't do anything.

Is there a solution for this?

thomasd3 avatar Oct 07 '18 16:10 thomasd3

It looks like it was missing a:

links:

  • mongodb

section and, while it seems obvious, I haven't seen it in the various threads on the topic, so it may be good to leave this here as a reminder.

thomasd3 avatar Oct 07 '18 16:10 thomasd3

Had the same problem. After adding

links:
 - mongodb

it worked. Can someone explain why this is needed? The documentation says:

Links are not required to enable services to communicate - by default, any service can reach any other service at that service’s name.

It also states that is is a legacy feature of docker and might be removed in the future.

My services are in the same network. Thanks.

N8th8n8el avatar Aug 20 '19 14:08 N8th8n8el