setup-mongo-docker.sh 341 B

12345678
  1. #!/bin/bash
  2. mongo ${MONGO_DATABASE} \
  3. --port ${MONGO_PORT} \
  4. -u ${MONGO_ROOT_USERNAME} \
  5. --authenticationDatabase "admin" \
  6. -p ${MONGO_ROOT_PASSWORD} \
  7. --eval "db.createUser({ user: '${MONGO_USER_USERNAME}', pwd: '${MONGO_USER_PASSWORD}', roles:[ { role:'readWrite', db: '${MONGO_DATABASE}' } ] } );"