mongodb.yml

 

2023-05-16

Docker Compose 配置文件:

1
version: '3.8'
2
3
services:
4
5
mongo:
6
image: mongo
7
container_name: mongo
8
restart: always
9
ports:
10
-27017:27017
11
volumes:
12
- /data/mongodb/db:/data/db
13
- /data/mongodb/data/log:/var/log/mongodb
14
- /data/mongodb/config:/etc/mongo
15
environment:
16
MONGO_INITDB_ROOT_USERNAME: username
17
MONGO_INITDB_ROOT_PASSWORD: password