cjvt-valency/dockerfiles/database/Makefile
2019-03-14 19:49:01 +01:00

19 lines
458 B
Makefile

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