Skip to content

Commit

Permalink
Merge pull request #52 from FX-Max/dev
Browse files Browse the repository at this point in the history
feat: add mongo-express
  • Loading branch information
FX-Max authored Oct 8, 2022
2 parents 20587e3 + 1170975 commit 4ca50be
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ docker-compose up -d redis

简要说明: [MongoDB](https://www.mongodb.com/) 是一个基于分布式文件存储的数据库。

- mongo-express

简要说明: [mongo-express](https://github.com/mongo-express/mongo-express) 是一个基于 Node.js 和 express 的开源的 MongoDB Web 管理工具。

- phpmyadmin

简要说明:[phpmyadmin](https://github.com/phpmyadmin/phpmyadmin) 是一款基于 Web 的 MySQL 数据库管理工具。

- redis
Expand Down
9 changes: 9 additions & 0 deletions mongo-express/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
############### MongoDB ###############
MONGO_PORT=27017
MONGO_ROOT_USERNAME=root
MONGO_ROOT_PASSWORD=123456

############### Mongo Express ###############
MONGO_EXPRESS_PORT=8081
ME_CONFIG_BASICAUTH_USERNAME=dev
ME_CONFIG_BASICAUTH_PASSWORD=dev
1 change: 1 addition & 0 deletions mongo-express/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
13 changes: 13 additions & 0 deletions mongo-express/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# example

## Usage

```bash
cp .env.example .env
docker-compose up -d mongo
docker-compose up -d mongo-express
```

访问: [http://127.0.0.1:8081](http://127.0.0.1:8081)

账号 dev,密码 dev,见 .env 中 ME_CONFIG_BASICAUTH_USERNAME 和 ME_CONFIG_BASICAUTH_PASSWORD 配置。
Empty file added mongo-express/conf/.gitignore
Empty file.
26 changes: 26 additions & 0 deletions mongo-express/conf/mongod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
storage:
dbPath: /data/db
journal:
enabled: true
directoryPerDB: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 8
directoryForIndexes: true

systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log

net:
port: 27017
bindIp: 0.0.0.0

processManagement:
timeZoneInfo: /usr/share/zoneinfo

replication:
oplogSizeMB: 51200
replSetName: rs0
2 changes: 2 additions & 0 deletions mongo-express/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
36 changes: 36 additions & 0 deletions mongo-express/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3'
services:
mongo:
image: 'mongo:latest'
container_name: mongo
ports:
- '${MONGO_PORT}:27017'
volumes:
- './data/mongodb:/data/db'
- './log/mongodb:/var/log/mongodb'
- './conf:/etc/mongo'
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
networks:
- mongo-net
mongo-express:
image: 'mongo-express:latest'
container_name: mongo-express
ports:
- '${MONGO_EXPRESS_PORT}:8081'
environment:
ME_CONFIG_BASICAUTH_USERNAME: ${ME_CONFIG_BASICAUTH_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_CONFIG_BASICAUTH_PASSWORD}
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_ROOT_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_ROOT_PASSWORD}
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_PORT: 27017
depends_on:
- mongo
networks:
- mongo-net
networks:
mongo-net:
driver: bridge
name: mongo-net
2 changes: 2 additions & 0 deletions mongo-express/log/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 4ca50be

Please sign in to comment.