You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
336 B

set -Eeuo pipefail
mongo -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin "$MONGO_INITDB_DATABASE" <<EOF
db.createUser({
user: '$MONGO_INITDB_USERNAME',
pwd: '$MONGO_INITDB_PASSWORD',
roles: [ { role: 'readWrite', db: '$MONGO_INITDB_DATABASE' } ]
})
EOF