1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-21 01:27:01 +02:00
dockerfiles/mongo
2024-10-17 16:05:16 +08:00
..
docker-compose.yml update mongo 2024-10-17 16:05:16 +08:00
README.md update 2021-12-01 18:11:40 +08:00

mongo

MongoDB is an open-source, document database designed for ease of development and scaling.

up and running

$ pwgen -1 8 1
Aedahwa7

$ docker-compose up -d

$ docker-compose cp mongo:/usr/bin/mongo /usr/local/bin/

$ mongo mongodb://root:root@localhost:27017/admin
>>> use mydb
>>> db.createUser({user: 'myuser', pwd: 'Aedahwa7', roles: [{role: 'readWrite', db: 'mydb'}]})
>>> exit

$ mongo mongodb://myuser:Aedahwa7@localhost:27017/mydb
>>> show collections
>>> exit

Read this and this for more help.