charlieanstey
3/23/2017 - 4:29 PM

MongoDB for LearningLocker on Docker

#MongoDB for LearningLocker on #Docker #Shell

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" } ] });