Skip to content

Instantly share code, notes, and snippets.

@hoiheart
Created February 6, 2020 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoiheart/e4ea6f20e1f48dd1cc28299867d75311 to your computer and use it in GitHub Desktop.
Save hoiheart/e4ea6f20e1f48dd1cc28299867d75311 to your computer and use it in GitHub Desktop.
docker-compose mongo init 설정 (sh)
#!/bin/bash
set -e
mongo <<EOF
use $MONGO_INITDB_DATABASE
db.createUser({
user: '$MONGO_INITDB_ROOT_USERNAME',
pwd: '$MONGO_INITDB_ROOT_PASSWORD',
roles: [{
role: 'readWrite',
db: '$MONGO_INITDB_DATABASE'
}]
})
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment