services:
  api-gateway:
    ports:
      - "4000:4000"
  
  workflow-orchestrator-service:
    ports:
      - "8005:8005"  # Expose for debugging if needed
    volumes:
      - workflow_data:/mnt/workflow_data
    environment:
      - WORKFLOW_DATA_PATH=/mnt/workflow_data

  alphavantage-provider-service:
    volumes:
      - workflow_data:/mnt/workflow_data
    environment:
      - WORKFLOW_DATA_PATH=/mnt/workflow_data

  tushare-provider-service:
    volumes:
      - workflow_data:/mnt/workflow_data
    environment:
      - WORKFLOW_DATA_PATH=/mnt/workflow_data

  finnhub-provider-service:
    volumes:
      - workflow_data:/mnt/workflow_data
    environment:
      - WORKFLOW_DATA_PATH=/mnt/workflow_data

  yfinance-provider-service:
    volumes:
      - workflow_data:/mnt/workflow_data
    environment:
      - WORKFLOW_DATA_PATH=/mnt/workflow_data

  report-generator-service:
    volumes:
      - workflow_data:/mnt/workflow_data
    environment:
      - WORKFLOW_DATA_PATH=/mnt/workflow_data

  mock-provider-service:
    build:
      context: .
      dockerfile: services/mock-provider-service/Dockerfile
    container_name: mock-provider-service
    environment:
      SERVER_PORT: 8006
      NATS_ADDR: nats://nats:4222
      API_GATEWAY_URL: http://api-gateway:4000
      SERVICE_HOST: mock-provider-service
      WORKFLOW_DATA_PATH: /mnt/workflow_data
      RUST_LOG: info
    volumes:
      - workflow_data:/mnt/workflow_data
    depends_on:
      - nats
    networks:
      - app-network
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:8006/health >/dev/null || exit 1"]
      interval: 5s
      timeout: 5s
      retries: 12

volumes:
  workflow_data:
