mongo-express-docker icon indicating copy to clipboard operation
mongo-express-docker copied to clipboard

[Bug] Docker entrypoint breaks possibility to use linux socket

Open Yivan opened this issue 4 years ago • 3 comments

Hello,

First thanks for providing this great software !

We wanted to link mogo-express to mongodb by unix socket (as our mongodb is open via socket only for performance and security reason), but when we set ME_CONFIG_MONGODB_URL as a socket connection (ie: mongodb:///tmp/mongodb-27017.sock) in docker log the message ... retrying to connect ... keeps reapeating. (we tried with mongodb://%2Ftmp%2Fmongodb-27017.sock too).

After diging into the entrypoint it seems it cannot work at all with linux socket as it check for tcp connection, please see: https://github.com/mongo-express/mongo-express-docker/blob/master/docker-entrypoint.sh#L14

The native mongo-express seems to be able to works with socket, but this docker entrypoint limitation seems to defeat all socket use as it check only and wait for tcp connection.

Purpose of this issue is to change the entry point to check for socket connexion too.

Thanks.

Yivan avatar Oct 23 '20 23:10 Yivan

Hi @Yivan, would you be able to check if you problem may relate to this? https://github.com/mongo-express/mongo-express-docker/issues/52

taboca avatar Jan 26 '21 16:01 taboca

@taboca Hi thanks for comming back on this issue. No it isn't linked. Problème on this issue is not a max try problem as this is socket connection on the same computer (and no other service use mongo db) so ti is not overload at all and is totaly available for connection. Problem is the protocol is hardcoded as tcp please see: https://github.com/mongo-express/mongo-express-docker/blob/master/docker-entrypoint.sh#L14 , on in my case I would like to use unix filesocket (mongodb:///tmp/mongodb-27017.sock). So this is the first condition exec 6<>/dev/tcp/$host/$port which is the problem in my case. Thanks!

Yivan avatar Jan 26 '21 18:01 Yivan

Hello, no news on this one ? Like Said in my previous comment problem seems to come from https://github.com/mongo-express/mongo-express-docker/blob/master/docker-entrypoint.sh#L14

Yivan avatar Apr 26 '21 15:04 Yivan