version: '2.1' services: shard1_replica1: image: khezen/mongo:3.4 container_name: "node1" environment: RS_NAME: shard1 REQUIRE_SSL: 'y' AUTH: 'y' STORAGE_ENGINE: wiredTiger ADMIN_USER: admin ADMIN_PWD: password KEY_FILE: "/etc/ssl/mongodb.pem" CA_FILE: "/etc/ssl/ca.pem" DB_NAME: "newtest" DB_USER: "user" DB_PWD: "userpass" OPLOG_SIZE: 16 logging: driver: none volumes: - /data/mongo/replica1:/data/db ports: - "27011:27017" networks: - mongo_cluster restart: on-failure shard1_replica2: image: khezen/mongo:3.4 container_name: "node2" environment: RS_NAME: 'shard1' REQUIRE_SSL: 'y' AUTH: 'y' STORAGE_ENGINE: wiredTiger ADMIN_USER: "admin" ADMIN_PWD: "password" KEY_FILE: "/etc/ssl/mongodb.pem" CA_FILE: "/etc/ssl/ca.pem" DB_NAME: "newtest" DB_USER: "user" DB_PWD: "userpass" OPLOG_SIZE: 16 logging: driver: none volumes: - /data/mongo/replica2:/data/db ports: - "27012:27017" networks: - mongo_cluster restart: on-failure shard1_replica3: image: khezen/mongo:3.4 container_name: "node3" environment: RS_NAME: 'shard1' REQUIRE_SSL: 'y' STORAGE_ENGINE: wiredTiger ADMIN_USER: "admin" ADMIN_PWD: "password" KEY_FILE: "/etc/ssl/mongodb.pem" CA_FILE: "/etc/ssl/ca.pem" DB_NAME: "newtest" DB_USER: "user" DB_PWD: "userpass" OPLOG_SIZE: 16 MASTER: shard1_replica3 SLAVES: shard1_replica1 shard1_replica2 AUTH: 'y' logging: driver: none volumes: - /data/mongo/replica3:/data/db ports: - "27013:27017" networks: - mongo_cluster restart: on-failure # Mongo_Trigger mongo_trigger: build: . depends_on: - shard1_replica3 - shard1_replica2 - shard1_replica1 environment: ADMIN_USER: admin ADMIN_PWD: password OBSERVED_DB_NAME: test OBSERVED_COLL_NAME: testcoll networks: - mongo_cluster restart: on-failure networks: mongo_cluster: driver: bridge