# Copyright 2024 RustFS Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Docker Compose override file for High Availability Tempo setup
#
# Usage:
# docker-compose -f docker-compose-example-for-rustfs.yml \
#                -f docker-compose-tempo-ha-override.yml up

services:
  # Override Tempo to use high-availability configuration
  tempo:
    volumes:
      - ./tempo-ha.yaml:/etc/tempo.yaml:ro
      - tempo-data:/var/tempo
    ports:
      - "3200:3200"   # Tempo HTTP
      - "4317:4317"   # OTLP gRPC
      - "4318:4318"   # OTLP HTTP
      - "7946:7946"   # Memberlist
      - "14250:14250" # Jaeger gRPC
      - "14268:14268" # Jaeger Thrift HTTP
      - "9411:9411"   # Zipkin
    environment:
      - TEMPO_MEMBERLIST_BIND_PORT=7946
    healthcheck:
      test: [ "CMD", "wget", "--spider", "-q", "http://localhost:3200/ready" ]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    depends_on:
      - redpanda

volumes:
  tempo-data:
    driver: local
    driver_opts:
      type: tmpfs
      device: tmpfs
      o: "size=4g"  # Allocate 4GB tmpfs for Tempo data (adjust based on your needs)

# Network configuration remains the same
# networks:
#   otel-network:
#     driver: bridge
#     name: "network_otel"
#     ipam:
#       config:
#         - subnet: 172.28.0.0/16

