Configuring MongoDB 'admin' Credentials

The MongoDB admin credentials are defined in the infrastructure Docker descriptor. They are used for MongoDB database user creation and by the Optimization server master.

To Configure MongoDB 'admin' Credentials

  1. Edit deployment/docker/infra/docker-compose.yml and change the MONGO_INITDB_ROOT_PASSWORD environment variable.

    mongo:
        ...
        environment:
        - MONGO_INITDB_ROOT_USERNAME=admin
        - MONGO_INITDB_ROOT_PASSWORD # Not specifying a value allow to transmit environment variable to the container.
  2. Edit the .env file placed in the docker-compose.yml parent folder and add an environment variable MONGO_INITDB_ROOT_PASSWORD with the password you have chosen. Note that you can also add the environment variable to the host machine.

  3. Edit deployment/docker/dbos/docker-compose.yml and change the environment variable SPRING_DATA_MONGODB_ADMIN_PASSWORD.

    dbos-master:
        ...
        environment:
        - SPRING_DATA_MONGODB_ADMIN_USER=admin
        - SPRING_DATA_MONGODB_ADMIN_PASSWORD # Not specifying a value allow to transmit environment variable to the container.
  4. Edit the .env file placed in the docker-compose.yml parent folder and add an environment variable MONGODB_DBOS_PASSWORD with the password you have chosen. Note that you can also add the environment variable to the host machine.