Last active
September 16, 2021 03:01
-
-
Save aaronksaunders/06b1808e95440e32ed74e7d38161a86d to your computer and use it in GitHub Desktop.
Revisions
-
aaronksaunders revised this gist
Sep 16, 2021 . No changes.There are no files selected for viewing
-
aaronksaunders revised this gist
Sep 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,2 @@ # Docker With Mongo My helper for creating a docker container running mongo where i set the super and then create a user. I also want the data to persist so i have added a volume -
aaronksaunders created this gist
Sep 16, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ version: '3' services: mongodb: image: mongo:4.2 environment: MONGO_INITDB_ROOT_USERNAME: aks_root MONGO_INITDB_ROOT_PASSWORD: aks_root ports: - '27017:27017' volumes: - db_data:/data/db - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro volumes: db_data: This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ conn = new Mongo(); db = conn.getDB("test-database"); db.createUser( { user: "test-user", pwd: "test-password", roles: [ { role: "dbOwner", db: "test-database" } ] } ); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ #Docker With Mongo My helper for creating a docker container running mongo where i set the super and then create a user. I also want the data to persist so i have added a volume