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

Fix default config.

Open sky0014 opened this issue 3 years ago • 2 comments

This change is Reviewable

When ME_CONFIG_MONGODB_URL is set, other envs will be ignored like ME_CONFIG_MONGODB_PORT, ME_CONFIG_MONGODB_AUTH_DATABASE etc.

So ME_CONFIG_MONGODB_URL should not set by default, is better to set by user.

Btw, mongo offical docker hub page used mongo-express, and it's example can't work now, this pr should fix this.

from https://hub.docker.com/_/mongo

# Use root/example as user/password credentials
version: '3.1'

services:

  mongo:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: root
      ME_CONFIG_MONGODB_ADMINPASSWORD: example

sky0014 avatar Jul 21 '21 10:07 sky0014

This fix, in Dockerfile, add ME_CONFIG_MONGODB_SERVER env var that will be removed with #957. Since the logic became once (only ME_CONFIG_MONGODB_URL), we need to consider if remove ME_CONFIG_MONGODB_URL from Dockerfile (it can be replaced on container run with -e option).

For me, the ME_CONFIG_MONGODB_URL env var can remain (it's used as a default value); imply that this issue can be closed after #957.

FYI @BlackthornYugen @shakaran

rtritto avatar Sep 20 '22 18:09 rtritto

Potentially could also set up this fix in a .env file like what I suggested with #983

OOCAZ avatar Sep 21 '22 18:09 OOCAZ

As said, after #957, this change isn't needed.

FYI @shakaran @BlackthornYugen

rtritto avatar Jul 09 '23 21:07 rtritto