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

services:
  valkey-primary:
    image: docker.io/bitnami/valkey:9.0
    ports:
      - '6379'
    environment:
      - VALKEY_REPLICATION_MODE=primary
      - VALKEY_PASSWORD=my_password
      - VALKEY_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
    volumes:
      - 'valkey_data:/bitnami/valkey/data'

  valkey-replica:
    image: docker.io/bitnami/valkey:9.0
    ports:
      - '6379'
    depends_on:
      - valkey-primary
    environment:
      - VALKEY_REPLICATION_MODE=replica
      - VALKEY_PRIMARY_HOST=valkey-primary
      - VALKEY_PRIMARY_PORT_NUMBER=6379
      - VALKEY_PRIMARY_PASSWORD=my_password
      - VALKEY_PASSWORD=my_password
      - VALKEY_DISABLE_COMMANDS=FLUSHDB,FLUSHALL

volumes:
  valkey_data:
    driver: local
