# Docker Compose Platform Stack - CI/CD Mode
# API-driven, ephemeral, optimized for pipeline integration
# Minimal UI, focus on automation and performance

{
  version = "3.8",

  services = {
    orchestrator = {
      image = "provisioning-orchestrator:latest",
      container_name = "orchestrator-cicd",
      ports = [
        "9090:9090",
      ],
      environment = {
        ORCHESTRATOR_MODE = "cicd",
        ORCHESTRATOR_SERVER_HOST = "0.0.0.0",
        ORCHESTRATOR_SERVER_PORT = "9090",
        ORCHESTRATOR_STORAGE_BACKEND = "filesystem",
        ORCHESTRATOR_STORAGE_PATH = "/tmp/orchestrator",
        ORCHESTRATOR_QUEUE_MAX_CONCURRENT_TASKS = "20",
        ORCHESTRATOR_BATCH_PARALLEL_LIMIT = "10",
        ORCHESTRATOR_LOG_LEVEL = "warn",
        RUST_LOG = "warn",
      },
      tmpfs = [
        "/tmp/orchestrator",
      ],
      networks = ["provisioning"],
      restart = "no",
      healthcheck = {
        test = ["CMD", "curl", "-f", "http://localhost:9090/health"],
        interval = "10s",
        timeout = "5s",
        retries = 3,
        start_period = "20s",
      },
    },

    api-gateway = {
      image = "provisioning-api-gateway:latest",
      container_name = "api-gateway",
      ports = [
        "8000:8000",
      ],
      environment = {
        API_GATEWAY_MODE = "cicd",
        API_GATEWAY_HOST = "0.0.0.0",
        API_GATEWAY_PORT = "8000",
        API_GATEWAY_ORCHESTRATOR_URL = "http://orchestrator:9090",
        API_GATEWAY_LOG_LEVEL = "warn",
      },
      networks = ["provisioning"],
      restart = "no",
      depends_on = {
        orchestrator = {
          condition = "service_healthy",
        },
      },
      healthcheck = {
        test = ["CMD", "curl", "-f", "http://localhost:8000/health"],
        interval = "10s",
        timeout = "5s",
        retries = 3,
        start_period = "20s",
      },
    },
  },

  networks = {
    provisioning = {
      driver = "bridge",
    },
  },
}
