2021-10-31 13:02:29 +00:00
|
|
|
Launch plain docker file
|
|
|
|
|
|
|
|
docker run -d -p 27017:27017 -v ~/dataMongo:/data/db mongo
|
|
|
|
|
|
|
|
Create a user (root) and any other databases (with users)
|
|
|
|
|
|
|
|
Close and re-run docker file with auth enabled (DBs Should persist)
|
|
|
|
|
2021-12-22 22:59:28 +00:00
|
|
|
docker run -d -p 27017:27017 -v ~/dataMongo:/data/db --restart unless-stopped mongo --auth
|