“Docker mongo”的版本间的差异
跳到导航
跳到搜索
第51行: | 第51行: | ||
[http://www.runoob.com/docker/docker-install-mongodb.html Docker 安装 MongoDB] | [http://www.runoob.com/docker/docker-install-mongodb.html Docker 安装 MongoDB] | ||
+ | =see also= | ||
+ | [https://blog.csdn.net/shenchen8274/article/details/119759866 docker-compose部署mongodb集群] | ||
=on pi3= | =on pi3= | ||
2021年9月23日 (四) 01:30的版本
cat docker-compose.yml version: "3" services: mongodb: image: mongo:4.2 container_name: mongodb4.2 ports: - "27017-27019:27017-27019" volumes: # - /Users/Pie/docker-lnmp/conf/mongodb/:/etc/mongo/:rw - /data/db_data/mongodb/:/data/db/:rw - /data/log/mongodb/:/var/log/mongodb/:rw environment: #设置后台登录用户和密码,没设置默认为:guest/guest MONGO_INITDB_ROOT_USERNAME: "root" MONGO_INITDB_ROOT_PASSWORD: example36 TZ: "Asia/Shanghai" restart: always networks: - default