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

New image does not read env variable ME_CONFIG_MONGODB_SERVER

Open roskee opened this issue 1 year ago • 2 comments

The following docker run command (assuming there is a mongodb running on the same network with the name db) works with the 1.0.0-alpha image but does not work with new images including 1.0.0 and latest. I have run the command multiple times only switching the image tag. It only works with the older images. Is there a change in the way values are provided that is not added in the docker hub documentation?

docker run -it --rm \
    --network bp8fitness-backend_default \
    --name mongo-express \
    -p 8083:8081 \
    -e ME_CONFIG_OPTIONS_EDITORTHEME="ambiance" \
    -e ME_CONFIG_MONGODB_SERVER="db" \
    -e ME_CONFIG_BASICAUTH_USERNAME="user" \
    -e ME_CONFIG_BASICAUTH_PASSWORD="fairly long password" \
    mongo-express:1.0.0-alpha

roskee avatar Jan 16 '24 14:01 roskee

I ran in the same issue. As a workaround I used ME_CONFIG_MONGODB_URL=. For example, connecting to a locally installed database:

docker run \
  --network host \
  -e ME_CONFIG_MONGODB_URL="mongodb://localhost:27017/app" \
  -e ME_CONFIG_BASICAUTH_USERNAME=user \
  -e ME_CONFIG_BASICAUTH_PASSWORD=pass \
  mongo-express

mark-gerarts avatar Feb 21 '24 07:02 mark-gerarts

The documentation on Docker Hub is outdated: see https://github.com/mongo-express/mongo-express/issues/1414 and #106 The usage of ME_CONFIG_MONGODB_SERVER has been changed, normally you would use ME_CONFIG_MONGODB_URL, e.g. mongodb://admin:password@mongodb:27017

maddes-b avatar Feb 21 '24 13:02 maddes-b