version: "3.7" networks: mother: external: true services: mongoprimary: image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5 volumes: - /volume/mongo/primary:/bitnami/mongodb environment: - MONGODB_REPLICA_SET_MODE=primary - MONGODB_REPLICA_SET_NAME=igrep - MONGODB_ADVERTISED_HOSTNAME=mongoprimary - MONGODB_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l - MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica deploy: update_config: parallelism: 1 delay: 10s order: start-first restart_policy: condition: any delay: 5s max_attempts: 3 window: 120s resources: limits: cpus: '0.5' memory: 350M replicas: 1 mode: replicated placement: constraints: - node.role == worker ports: - "27011:27017" networks: - mother healthcheck: test: ["CMD", "mongo", "--eval", "printjson(db.isMaster())" ] interval: 10s timeout: 5s retries: 3 start_period: 5s mongosecondary: image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5 environment: - MONGODB_REPLICA_SET_MODE=secondary - MONGODB_REPLICA_SET_NAME=igrep - MONGODB_ADVERTISED_HOSTNAME=mongosecondary - MONGODB_INITIAL_PRIMARY_HOST=mongoprimary - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l - MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica volumes: - /volume/mongo/secondary:/bitnami/mongodb deploy: update_config: parallelism: 1 delay: 10s order: start-first restart_policy: condition: any delay: 5s max_attempts: 3 window: 120s resources: limits: cpus: '0.25' memory: 350M mode: replicated replicas: 1 placement: constraints: - node.role == worker ports: - "27012:27017" networks: - mother healthcheck: test: ["CMD", "mongo", "--eval", "printjson(db.isMaster())" ] interval: 10s timeout: 5s retries: 3 start_period: 5s mongoarbiter: image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5 environment: - MONGODB_REPLICA_SET_MODE=arbiter - MONGODB_REPLICA_SET_NAME=igrep - MONGODB_ADVERTISED_HOSTNAME=mongoarbiter - MONGODB_INITIAL_PRIMARY_HOST=mongoprimary - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l - MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica deploy: update_config: parallelism: 1 delay: 10s order: start-first restart_policy: condition: any delay: 5s max_attempts: 3 window: 120s resources: limits: cpus: '0.2' memory: 100M mode: replicated replicas: 1 placement: constraints: - node.role == worker networks: - mother healthcheck: test: ["CMD", "mongo", "--eval", "printjson(db.isMaster())" ] interval: 10s timeout: 5s retries: 3 start_period: 5s