# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

services:
  consul-node1:
    image: docker.io/bitnami/consul:1
    environment:
      - CONSUL_BOOTSTRAP_EXPECT=3
      - CONSUL_CLIENT_LAN_ADDRESS=0.0.0.0
      - CONSUL_DISABLE_KEYRING_FILE=true
      - CONSUL_RETRY_JOIN_ADDRESS=consul-node1
    ports:
      - '8300:8300'
      - '8301:8301'
      - '8301:8301/udp'
      - '8500:8500'
      - '8600:8600'
      - '8600:8600/udp'
    volumes:
      - 'consul-node1_data:/bitnami'

  consul-node2:
    image: docker.io/bitnami/consul:1
    environment:
      - CONSUL_BOOTSTRAP_EXPECT=3
      - CONSUL_CLIENT_LAN_ADDRESS=0.0.0.0
      - CONSUL_DISABLE_KEYRING_FILE=true
      - CONSUL_RETRY_JOIN_ADDRESS=consul-node1
      - CONSUL_ENABLE_UI=false
    volumes:
      - 'consul-node2_data:/bitnami'

  consul-node3:
    image: docker.io/bitnami/consul:1
    environment:
      - CONSUL_BOOTSTRAP_EXPECT=3
      - CONSUL_CLIENT_LAN_ADDRESS=0.0.0.0
      - CONSUL_DISABLE_KEYRING_FILE=true
      - CONSUL_RETRY_JOIN_ADDRESS=consul-node1
      - CONSUL_ENABLE_UI=false
    volumes:
      - 'consul-node3_data:/bitnami'

volumes:
  consul-node1_data:
    driver: local
  consul-node2_data:
    driver: local
  consul-node3_data:
    driver: local
