version: "3.7"

services:
  qdrant_node_1:
    image: qdrant_consensus:latest
    environment:
      - QDRANT__SERVICE__GRPC_PORT=6334
      - QDRANT__CLUSTER__ENABLED=true
      - QDRANT__CLUSTER__P2P__PORT=6335
    ports:
      - "6333:6333"
      - "6334:6334"
    command: ./qdrant --uri 'http://qdrant_node_1:6335'
#    deploy:
#      resources:
#        limits:
#          cpus: '0.07'


  qdrant_node_follower:
    image: qdrant_consensus:latest
    environment:
      - QDRANT__SERVICE__GRPC_PORT=6334
      - QDRANT__CLUSTER__ENABLED=true
      - QDRANT__CLUSTER__P2P__PORT=6335
    depends_on:
      - qdrant_node_1
    ports:
      - "6433:6333"
      - "6434:6334"
    command: bash -c "sleep 5 && ./qdrant --bootstrap 'http://qdrant_node_1:6335' --uri 'http://qdrant_node_follower:6335'"
#    deploy:
#      resources:
#        limits:
#          cpus: '0.05'


  qdrant_node_follower_2:
    image: qdrant_consensus:latest
    environment:
      - QDRANT__SERVICE__GRPC_PORT=6334
      - QDRANT__CLUSTER__ENABLED=true
      - QDRANT__CLUSTER__P2P__PORT=6335
    depends_on:
      - qdrant_node_1
    ports:
      - "6533:6333"
      - "6534:6334"
    command: bash -c "sleep 6 && ./qdrant --bootstrap 'http://qdrant_node_1:6335' --uri 'http://qdrant_node_follower_2:6335'"
#    deploy:
#      resources:
#        limits:
#          cpus: '0.03'
