You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
488 B
Markdown
34 lines
488 B
Markdown
|
4 years ago
|
# Setup mongo
|
||
|
|
|
||
|
|
1. Start docker
|
||
|
|
|
||
|
|
```
|
||
|
|
$ docker-composer up -d
|
||
|
|
```
|
||
|
|
|
||
|
|
2. to enter CLI
|
||
|
|
|
||
|
|
```
|
||
|
|
// check image name
|
||
|
|
$ docker ps
|
||
|
|
|
||
|
|
// enter interactive bash shell
|
||
|
|
$ docker exec -it mongo-5-mongo-1 bash
|
||
|
|
|
||
|
|
// enter to mongo shell
|
||
|
|
$ docker exec -it mongo-5-mongo-1 mongosh "mongodb://root@localhost:27017"
|
||
|
|
```
|
||
|
|
|
||
|
|
3. To test server. Using robo-3t to connect `localhost:27017`. login : `root` password : `example`
|
||
|
|
|
||
|
|
4. Stop server
|
||
|
|
```
|
||
|
|
$ docker-compose down
|
||
|
|
```
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
Ports
|
||
|
|
|
||
|
|
* 27017 : mongo
|
||
|
|
* 8081 : mongo-express
|