Last active
May 1, 2018 11:30
-
-
Save charlieanstey/f45b4a83b85a8da3572e54d63533d57c to your computer and use it in GitHub Desktop.
#MongoDB for LearningLocker on #Docker #Shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run \ | |
--detach \ | |
--restart always \ | |
--name mongo \ | |
--publish 27017:27017 \ | |
--volume /Users/Charlie/Docker/Volumes/mongo-data:/data/db \ | |
--volume /Users/Charlie/Docker/Volumes/mongo-config:/data/configdb \ | |
mongo:3.4.14-jessie --auth | |
docker exec -it mongo mongo admin | |
db.createUser({ user: 'admin', pwd: 'testpass1', roles: [ { role: "root", db: "admin" } ] }); | |
db.auth('admin','testpass1'); | |
use lrs; | |
db.createUser({ user: 'learninglocker', pwd: 'testpass1', roles: [ { role: "readWrite", db: "lrs" } ] }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment