
# CI/CD Mode - Add automation and API server
# Usage: docker-compose -f infrastructure/docker/docker-compose.yaml -f infrastructure/docker/docker-compose.multi-user.yaml -f infrastructure/docker/docker-compose.cicd.yaml up

services:
  orchestrator:
    environment:
      - PROVISIONING_MODE=cicd
      - ORCHESTRATOR_MAX_CONCURRENT_TASKS=20
      - ORCHESTRATOR_API_ENABLED=true
      - ORCHESTRATOR_WEBHOOK_ENABLED=true
    deploy:
      resources:
        limits:
          cpus: '4.0'
          memory: 4096M

  control-center:
    environment:
      - PROVISIONING_MODE=cicd
      - CONTROL_CENTER_API_KEYS_ENABLED=true
      - CONTROL_CENTER_WEBHOOK_ENABLED=true

  # Add Jenkins integration (optional)
  jenkins:
    profiles:
      - cicd-jenkins
    image: jenkins/jenkins:lts
    container_name: provisioning-jenkins
    ports:
      - "8090:8080"
      - "50000:50000"
    volumes:
      - jenkins-data:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - JENKINS_OPTS=--prefix=/jenkins
    user: root
    restart: unless-stopped
    networks:
      - provisioning-net-frontend
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 2048M

  # Add GitLab Runner (optional)
  gitlab-runner:
    profiles:
      - cicd-gitlab
    image: gitlab/gitlab-runner:latest
    container_name: provisioning-gitlab-runner
    volumes:
      - gitlab-runner-config:/etc/gitlab-runner
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped
    networks:
      - provisioning-net-frontend
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 2048M

volumes:
  jenkins-data:
    driver: local
  gitlab-runner-config:
    driver: local

networks:
  provisioning-net-frontend:
    driver: bridge
  provisioning-net-backend:
    driver: bridge
