cjvt-valency/dockerfiles/database/Makefile

19 lines
458 B
Makefile
Raw Normal View History

2019-03-14 18:49:01 +00:00
# db names: nameDB
# collection names: lower case, plural
# user names?
# mongo admin -u root -p password --eval "db.getSiblingDB('vlDB').addUser('vluser', 'password')"
.PHONY: start_db
all: run_stack create_users
run_stack:
docker stack deploy --compose-file mongo-stack.yml dbstack
create_users:
docker exec -it mongo-container /bin/bash
mongo -u root -p example
use valDB
db.createUser({user: "kristjan", pwd: "password", roles: ["readWrite"]})