From d223cac8b1a93c168e8aade5f9687609198e7d0d Mon Sep 17 00:00:00 2001 From: luke-else Date: Sun, 31 Oct 2021 14:02:29 +0100 Subject: [PATCH] Added mongo Dockerfile --- MongoDB/Dockerfile | 4 ++++ MongoDB/instructions | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 MongoDB/Dockerfile create mode 100644 MongoDB/instructions diff --git a/MongoDB/Dockerfile b/MongoDB/Dockerfile new file mode 100644 index 0000000..df956e5 --- /dev/null +++ b/MongoDB/Dockerfile @@ -0,0 +1,4 @@ +FROM mongo:latest + +EXPOSE 27017 + diff --git a/MongoDB/instructions b/MongoDB/instructions new file mode 100644 index 0000000..4e95439 --- /dev/null +++ b/MongoDB/instructions @@ -0,0 +1,9 @@ +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) + + docker run -d -p 27017:27017 -v ~/dataMongo:/data/db mongo --auth