Docker mongo
跳到导航
跳到搜索
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