1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| version: '3' services: mongo-master: container_name: mongo-master image: mongo:4.4.3 environment: MONGO_INITDB_ROOT_USERNAME: username MONGO_INITDB_ROOT_PASSWORD: password MONGO_INITDB_DATABASE: admin volumes: - ./data/db-master:/data/db - ./data/key_file:/data/configdb/key_file ports: - 27017:27017 command: ["mongod", "--bind_ip_all", "--dbpath", "/data/db", "--journal", "--logappend", "--storageEngine", "wiredTiger", "--replSet", "rs", "--oplogSize", "128", "--auth", "--keyFile=/data/configdb/key_file"] mongo-slave: container_name: mongo-slave image: mongo:4.4.3 environment: MONGO_INITDB_ROOT_USERNAME: username MONGO_INITDB_ROOT_PASSWORD: password MONGO_INITDB_DATABASE: admin volumes: - ./data/db-slave:/data/db - ./data/key_file:/data/configdb/key_file ports: - 27017:27017 command: ["mongod", "--bind_ip_all", "--dbpath", "/data/db", "--journal", "--logappend", "--storageEngine", "wiredTiger", "--replSet", "rs", "--oplogSize", "128", "--auth", "--keyFile=/data/configdb/key_file"] mongo-arbiter: container_name: mongo-arbiter image: mongo:4.4.3 environment: MONGO_INITDB_ROOT_USERNAME: username MONGO_INITDB_ROOT_PASSWORD: password MONGO_INITDB_DATABASE: admin volumes: - ./data/db-arbiter:/data/db - ./data/key_file:/data/configdb/key_file ports: - 27017:27017 command: ["mongod", "--bind_ip_all", "--dbpath", "/data/db", "--journal", "--logappend", "--storageEngine", "wiredTiger", "--replSet", "rs", "--oplogSize", "128", "--auth", "--keyFile=/data/configdb/key_file"]
|