docker-compose部署mogodb
mongodb的docker-copose.yaml文件
version: "3"
services:
mongodb:
image: mongo:4.2.8
container_name: mongo-baise #容器的名字
restart: always # 自动重启
privileged: true
ports:
- 27017:27017
volumes:
- "./dbs:/data/db"
启动mongodb
docker-compose -f docker-compse.yaml up -d