{"id":27155437,"url":"https://github.com/doguhannilt/mongodb-docker-starter","last_synced_at":"2026-05-02T06:36:11.158Z","repository":{"id":286202430,"uuid":"960705205","full_name":"Doguhannilt/mongodb-docker-starter","owner":"Doguhannilt","description":"Mongodb Docker Starter ","archived":false,"fork":false,"pushed_at":"2025-04-04T22:55:15.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T23:27:11.010Z","etag":null,"topics":["mongodb","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Doguhannilt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-04T22:51:13.000Z","updated_at":"2025-04-04T22:55:56.000Z","dependencies_parsed_at":"2025-04-04T23:37:19.736Z","dependency_job_id":null,"html_url":"https://github.com/Doguhannilt/mongodb-docker-starter","commit_stats":null,"previous_names":["doguhannilt/mongodb-docker-starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doguhannilt%2Fmongodb-docker-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doguhannilt%2Fmongodb-docker-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doguhannilt%2Fmongodb-docker-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Doguhannilt%2Fmongodb-docker-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Doguhannilt","download_url":"https://codeload.github.com/Doguhannilt/mongodb-docker-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247913861,"owners_count":21017213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mongodb","shell"],"created_at":"2025-04-08T19:40:17.822Z","updated_at":"2026-05-02T06:36:11.105Z","avatar_url":"https://github.com/Doguhannilt.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n## Quick Start\n\n### 1. Start the MongoDB Container\n\n```bash\n./scripts/start-db.sh\n```\n\nThis will:\n- Create a Docker volume (if not exists)\n- Create a Docker network (if not exists)\n- Start a MongoDB container with custom credentials\n- Mount an init script to configure your database and user\n\n---\n\n### 2. Stop \u0026 Clean Up the Environment\n\n```bash\n./scripts/cleanup.sh\n```\n\nThis will:\n- Remove the MongoDB container (if running)\n- Remove the Docker volume\n- Remove the Docker network\n\n---\n\n## ⚙️ Environment Configuration\n\nThe scripts rely on the following environment files:\n\n| File             | Description                     |\n|------------------|---------------------------------|\n| `.env.db`        | Database container name         |\n| `.env.network`   | Custom Docker network name      |\n| `.env.volume`    | Docker volume name              |\n\n\u003e Example `.env.db`:\n```env\nDB_CONTAINER_NAME=mongodb\n```\n\n---\n\n## 🧩 Initialization Script\n\nThe following file is mounted on container startup:\n\n```bash\ndb-config/mongo-init.js\n```\n\nIt creates the application-specific database and user with custom roles.\n\n\u003e Example content:\n```js\nconst key_value_db = process.env.KEY_VALUE_DB;\nconst keyValueUser = process.env.KEY_VALUE_USER;\nconst keyValuePassword = process.env.KEY_VALUE_PASSWORD;\n\ndb = db.getSiblingDB(key_value_db);\n\ndb.createUser({\n    user: keyValueUser,\n    pwd: keyValuePassword,\n    roles: [{ role: 'readWrite', db: key_value_db }]\n});\n```\n\n---\n\n## 📁 Project Structure\n\n```bash\n.\n├── db-config/\n│   └── mongo-init.js\n├── scripts/\n│   ├── start-db.sh\n│   └── cleanup.sh\n├── .env.db\n├── .env.network\n├── .env.volume\n└── README.md\n```\n\n---\n\n## 🧼 Notes\n\n- The MongoDB image used: `mongodb/mongodb-community-server:7.0-ubuntu2204`\n- Container is run with `--rm` so it's ephemeral. Data persists via Docker volume.\n- Ensure Docker is running before executing the scripts.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoguhannilt%2Fmongodb-docker-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoguhannilt%2Fmongodb-docker-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoguhannilt%2Fmongodb-docker-starter/lists"}