# 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. services: # --- Observability Stack --- tempo-init: image: busybox:latest command: [ "sh", "-c", "chown -R 10001:10001 /var/tempo" ] volumes: - tempo-data:/var/tempo user: root networks: - rustfs-network restart: "no" tempo: image: grafana/tempo:2.10.5 user: "10001" command: [ "-config.file=/etc/tempo.yaml" ] volumes: - ../../.docker/observability/tempo.yaml:/etc/tempo.yaml:ro - tempo-data:/var/tempo ports: - "3200:3200" # tempo - "4317" # otlp grpc - "4318" # otlp http - "7946" # memberlist restart: unless-stopped networks: - rustfs-network depends_on: tempo-init: condition: service_completed_successfully healthcheck: test: [ "CMD", "/tempo", "-version" ] interval: 10s timeout: 5s retries: 3 start_period: 15s otel-collector: image: otel/opentelemetry-collector-contrib:latest environment: - TZ=Asia/Shanghai volumes: - ../../.docker/observability/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro ports: - "1888:1888" # pprof - "8888:8888" # Prometheus metrics for Collector - "8889:8889" # Prometheus metrics for application indicators - "13133:13133" # health check - "4317:4317" # OTLP gRPC - "4318:4318" # OTLP HTTP - "55679:55679" # zpages networks: - rustfs-network depends_on: - tempo - jaeger - prometheus - loki restart: unless-stopped healthcheck: test: [ "CMD", "/otelcol-contrib", "--version" ] interval: 10s timeout: 5s retries: 3 jaeger: image: jaegertracing/jaeger:latest environment: - TZ=Asia/Shanghai - SPAN_STORAGE_TYPE=badger - BADGER_EPHEMERAL=false - BADGER_DIRECTORY_VALUE=/badger/data - BADGER_DIRECTORY_KEY=/badger/key - COLLECTOR_OTLP_ENABLED=true volumes: - ../../.docker/observability/jaeger.yaml:/etc/jaeger/config.yml:ro - jaeger-data:/badger ports: - "16686:16686" # Web UI - "14269:14269" # Admin/Metrics - "4317" # otlp grpc - "4318" # otlp http command: [ "--config", "/etc/jaeger/config.yml" ] networks: - rustfs-network restart: unless-stopped healthcheck: test: [ "CMD", "wget", "--spider", "-q", "http://localhost:14269" ] interval: 10s timeout: 5s retries: 3 start_period: 15s prometheus: image: prom/prometheus:latest environment: - TZ=Asia/Shanghai volumes: - ../../.docker/observability/prometheus.yml:/etc/prometheus/prometheus.yml:ro - ../../.docker/observability/prometheus-rules:/etc/prometheus/rules:ro - prometheus-data:/prometheus ports: - "9090:9090" command: - '--config.file=/etc/prometheus/prometheus.yml' - '--web.enable-otlp-receiver' - '--web.enable-remote-write-receiver' - '--enable-feature=promql-experimental-functions' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=30d' networks: - rustfs-network restart: unless-stopped healthcheck: test: [ "CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy" ] interval: 10s timeout: 5s retries: 3 loki: image: grafana/loki:latest environment: - TZ=Asia/Shanghai volumes: - ../../.docker/observability/loki.yaml:/etc/loki/loki.yaml:ro - loki-data:/loki ports: - "3100:3100" command: -config.file=/etc/loki/loki.yaml networks: - rustfs-network restart: unless-stopped healthcheck: test: [ "CMD", "wget", "--spider", "-q", "http://localhost:3100/ready" ] interval: 15s timeout: 10s retries: 5 start_period: 60s pyroscope: image: grafana/pyroscope:latest ports: - "4040:4040" command: - -self-profiling.disable-push=true networks: - rustfs-network restart: unless-stopped grafana: image: grafana/grafana:latest ports: - "3000:3000" # Web UI environment: - GF_SECURITY_ADMIN_PASSWORD=admin - GF_SECURITY_ADMIN_USER=admin - TZ=Asia/Shanghai - GF_INSTALL_PLUGINS=grafana-pyroscope-datasource - GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/var/lib/grafana/dashboards/home.json networks: - rustfs-network volumes: - ../../.docker/observability/grafana/provisioning:/etc/grafana/provisioning:ro - ../../.docker/observability/grafana/dashboards:/var/lib/grafana/dashboards:ro - grafana-data:/var/lib/grafana depends_on: - prometheus - tempo - loki restart: unless-stopped healthcheck: test: [ "CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health" ] interval: 10s timeout: 5s retries: 3 # --- RustFS Cluster --- node1: build: context: ../.. dockerfile: Dockerfile.source container_name: node1 environment: - RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_ADDRESS=:9000 - RUSTFS_CONSOLE_ENABLE=true - RUSTFS_OBS_ENDPOINT=http://otel-collector:4318 - RUSTFS_OBS_LOGGER_LEVEL=debug platform: linux/amd64 ports: - "9001:9000" networks: - rustfs-network depends_on: - otel-collector node2: build: context: ../.. dockerfile: Dockerfile.source container_name: node2 environment: - RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_ADDRESS=:9000 - RUSTFS_CONSOLE_ENABLE=true - RUSTFS_OBS_ENDPOINT=http://otel-collector:4318 - RUSTFS_OBS_LOGGER_LEVEL=debug platform: linux/amd64 ports: - "9002:9000" networks: - rustfs-network depends_on: - otel-collector node3: build: context: ../.. dockerfile: Dockerfile.source container_name: node3 environment: - RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_ADDRESS=:9000 - RUSTFS_CONSOLE_ENABLE=true - RUSTFS_OBS_ENDPOINT=http://otel-collector:4318 - RUSTFS_OBS_LOGGER_LEVEL=debug platform: linux/amd64 ports: - "9003:9000" networks: - rustfs-network depends_on: - otel-collector node4: build: context: ../.. dockerfile: Dockerfile.source container_name: node4 environment: - RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_ADDRESS=:9000 - RUSTFS_CONSOLE_ENABLE=true - RUSTFS_OBS_ENDPOINT=http://otel-collector:4318 - RUSTFS_OBS_LOGGER_LEVEL=debug platform: linux/amd64 ports: - "9004:9000" networks: - rustfs-network depends_on: - otel-collector volumes: prometheus-data: tempo-data: loki-data: jaeger-data: grafana-data: networks: rustfs-network: driver: bridge name: "network_rustfs_config" driver_opts: com.docker.network.enable_ipv6: "true"