version: '3.5'
networks:
  redis_stack_cluster_net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 173.18.0.0/24
services:
  #redisinsight:
  #  image: 'redis/redisinsight:latest'
  #  container_name: redisinsight-1
  #  ports:
  #    - '8001:8001'
  #    - '5540:5540'
  #  networks:
  #    redis_stack_cluster_net:
  #      ipv4_address: 173.18.0.12
  redis_node_7:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-node-7
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
    ports:
      - '7007:7007/tcp'
      - '6375:6379/tcp'
    volumes:
      - 'E:\software\redis\cluster\dump\7007:/data:rw'
      - 'E:\software\redis\cluster\7007\redis.conf:/usr/local/etc/redis/redis.conf'
    environment:
      - REDIS_ARGS = "--save 10 1 --appendonly yes"
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.7
  redis_node_2:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-node-2
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
    ports:
      - '7002:7002/tcp'
      - '26379:6379/tcp'
    volumes:
      - 'E:\software\redis\cluster\dump\7002:/data:rw'
      - 'E:\software\redis\cluster\7002\redis.conf:/usr/local/etc/redis/redis.conf'
    environment:
      - REDIS_ARGS = "--save 10 1 --appendonly yes"
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.2
  redis_node_3:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-node-3
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
    ports:
      - '7003:7003/tcp'
      - '36379:6379/tcp'
    volumes:
      - 'E:\software\redis\cluster\dump\7003:/data:rw'
      - 'E:\software\redis\cluster\7003\redis.conf:/usr/local/etc/redis/redis.conf'
    environment:
      - REDIS_ARGS = "--save 10 1 --appendonly yes"
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.3
  redis_node_4:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-node-4
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
    ports:
      - '7004:7004/tcp'
      - '46379:6379/tcp'
    volumes:
      - 'E:\software\redis\cluster\dump\7004:/data:rw'
      - 'E:\software\redis\cluster\7004\redis.conf:/usr/local/etc/redis/redis.conf'
    environment:
      - REDIS_ARGS = "--save 10 1 --appendonly yes"
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.4
  redis_node_5:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-node-5
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
    ports:
      - '7005:7005/tcp'
      - '56379:6379/tcp'
    volumes:
      - 'E:\software\redis\cluster\dump\7005:/data:rw'
      - 'E:\software\redis\cluster\7005\redis.conf:/usr/local/etc/redis/redis.conf'
    environment:
      - REDIS_ARGS = "--save 10 1 --appendonly yes"
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.5
  redis_node_6:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-node-6
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
    ports:
      - '7006:7006/tcp'
      - '6376:6379/tcp'
    volumes:
      - 'E:\software\redis\cluster\dump\7006:/data:rw'
      - 'E:\software\redis\cluster\7006\redis.conf:/usr/local/etc/redis/redis.conf'
    environment:
      - REDIS_ARGS = "--save 10 1 --appendonly yes"
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.6
  cluster_initiator:
    image: 'redis/redis-stack-server:latest'
    container_name: redis-cluster_initiator
    ports:
      - '8000:8000'
      - '6378:6379/tcp'
    #command: 'redis-cli --cluster create 173.18.0.2:7002 173.18.0.3:7003 173.18.0.4:7004 173.18.0.5:7005 173.18.0.6:7006 173.18.0.7:7007 --cluster-replicas 1 --cluster-yes'
    depends_on:
      - redis_node_3
      - redis_node_4
      - redis_node_5
      - redis_node_6
      - redis_node_7
      - redis_node_2
    networks:
      redis_stack_cluster_net:
        ipv4_address: 173.18.0.11