Last active
May 2, 2024 04:15
-
-
Save devzer01/0ebcdb6a4f5b6858ec30dcc7b767a538 to your computer and use it in GitHub Desktop.
Revisions
-
Nayana Hettiarachchi revised this gist
Jul 22, 2020 . 1 changed file with 7 additions and 10 deletions.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,18 +1,15 @@ version: '3' services: database: image: 'mongo' container_name: 'my-mongo-container' # give your contatner a name environment: - MONGO_INITDB_DATABASE=your-database-name # database name you want to make - MONGO_INITDB_ROOT_USERNAME=my-container-root-username # set your container root username - MONGO_INITDB_ROOT_PASSWORD=secret # set your contatner root password volumes: - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro - ./mongo-volume:/data/db ports: - '27017-27019:27017-27019' # ... other configs ... -
Nayana Hettiarachchi revised this gist
Jul 22, 2020 . 1 changed file with 12 additions and 0 deletions.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,12 @@ db.createUser( { user: "YourUsername", pwd: "“YourPasswordHere", roles: [ { role: "readWrite", db: "your-database-name" } ] } ) -
Nayana Hettiarachchi created this gist
Jul 22, 2020 .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,18 @@ version: '3' services: database: image: 'mongo' container_name: 'my-mongo-container' # give your contatner a name aA me) aliens - MONGO_INITDB_DATABASE=your-database-name # database name you want to make - MONGO_INITDB_ROOT_USERNAME=my-container-root-username # set your container root username - MONGO_INITDB_ROOT_PASSWORD=secret # set your contatner root password volumes: - ./init-mongo. js:/docker-entrypoint-initdb.d/init-mongo. js:ro - ./mongo-volume: /data/db ports: - '27017-27019:27017-27019' # ... other configs ... # found on https://medium.com/faun/managing-mongodb-on-docker-with-docker-compose-26bf8a0bbae3