server/MongoDB/instructions

15 lines
366 B
Plaintext
Raw Normal View History

2022-01-17 16:48:31 +00:00
Launch plain dockerfile
2021-10-31 13:02:29 +00:00
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)
docker run -d -p 27017:27017 -v ~/dataMongo:/data/db mongo --auth
2021-10-31 13:03:33 +00:00
2022-01-17 16:48:31 +00:00
https://stackoverflow.com/questions/42201233/mongodb-with-docker-authentication