mongo-express / mongo-express-docker

a dockerized mongo-express for viewing mongoDB in the browser
MIT License
198 stars 93 forks source link

New image does not read env variable ME_CONFIG_MONGODB_SERVER #120

Open roskee opened 5 months ago

roskee commented 5 months ago

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
mark-gerarts commented 4 months ago

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
maddes-b commented 4 months ago

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