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

services:
  redis-primary:
    image: docker.io/bitnami/redis:8.6
    ports:
      - '6379'
    environment:
      - REDIS_REPLICATION_MODE=master
      - REDIS_PASSWORD=my_password
      - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
    volumes:
      - 'redis_data:/bitnami/redis/data'

  redis-secondary:
    image: docker.io/bitnami/redis:8.6
    ports:
      - '6379'
    depends_on:
      - redis-primary
    environment:
      - REDIS_REPLICATION_MODE=slave
      - REDIS_MASTER_HOST=redis-primary
      - REDIS_MASTER_PORT_NUMBER=6379
      - REDIS_MASTER_PASSWORD=my_password
      - REDIS_PASSWORD=my_password
      - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL

volumes:
  redis_data:
    driver: local
