Skip to content

Instantly share code, notes, and snippets.

@kdssoftware
Last active June 23, 2021 20:20
Show Gist options
  • Save kdssoftware/826093b28de1a25c01cfe90fd1a6ed9b to your computer and use it in GitHub Desktop.
Save kdssoftware/826093b28de1a25c01cfe90fd1a6ed9b to your computer and use it in GitHub Desktop.
use admin
db.createUser(
{
user: "root",
pwd: "root",
roles:["root"]
}
);
use demo
db.CreateUser(
{
user: "demo",
pwd: "demo12345",
roles:[
{
role:"readwrite",
db:"demo"
}
]
}
);
version: '3.3'
services:
mongo:
container_name: mongodb
image: mongo
ports:
- "27017:27017"
volumes:
- mongodbdata:/data/db
command: [--auth]
restart: always
volumes:
mongodbdata:
networks:
default:
external:
name: mongo-network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment