services:
  # MongoDB Database Service
  mongodb:
    image: mongo:latest
    container_name: oms-mongodb
    ports:
      - "27717:27017"
    volumes:
      - /mnt/volume_sfo2_04/oms/mongodb:/data/db # 使用主机挂载卷用于生产环境
    environment:
      MONGO_INITDB_ROOT_USERNAME: oms
      MONGO_INITDB_ROOT_PASSWORD: "oms123."
    restart: "always"

  # Redis Cache Service
  redis:
    image: redis:latest
    container_name: oms-redis
    ports:
      - "6379:6379"
    restart: "always"

  # RabbitMQ Message Broker
  rabbitmq:
    image: rabbitmq:3-management-alpine
    container_name: oms-rabbitmq
    ports:
      - "5672:5672" # AMQP 端口
      - "15672:15672" # 管理界面端口
    environment:
      RABBITMQ_DEFAULT_USER: coloring
      RABBITMQ_DEFAULT_PASS: coloring123.
    restart: "always"

  # ClickHouse Columnar Database for Analytics
  clickhouse:
    image: clickhouse/clickhouse-server:latest
    container_name: clickhouse
    ports:
      - "8123:8123" # HTTP 接口
      # - "9000:9000" # 原生 TCP 接口
    volumes:
      - /mnt/volume_sfo2_04/oms/clickhouse:/var/lib/clickhouse # 使用主机挂载卷用于生产环境
    environment:
      CLICKHOUSE_DB: omsdb
      CLICKHOUSE_USER: ckuser
      CLICKHOUSE_PASSWORD: ckpassword
    restart: "always"
