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