Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yuanyu90221/mongo_docker_latest


https://github.com/yuanyu90221/mongo_docker_latest

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# mongo_docker_latest

## introduction

This is docker-compose.yml for latest mongo version

## verify

login into container

```script==
docker exec -it mongo ${MONGO_INITDB_ROOT_USERNAME} -p
```
## createUser for InitDB

```script===
db.createUser({"user":"username", "pwd":"pwd", "roles":[{"role":"readWrite", "db":"dbname"}]})
```
## run with demo
```script==
npm i
```
```script==
npm run demo
```
## setup config with .env
```script==
MONGO_INITDB_ROOT_USERNAME=
MONGO_INITDB_ROOT_PASSWORD=
PORT=
MONGO_HOST=
DB_NAME=
```