125 lines
3.1 KiB
YAML
125 lines
3.1 KiB
YAML
version: '3.8'
|
|
|
|
# CI/CD Mode - Add automation and API server
|
|
# Usage: docker-compose -f docker-compose.yaml -f docker-compose/docker-compose.multi-user.yaml -f docker-compose/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
|
|
|
|
# Enable Provisioning API Server
|
|
api-server:
|
|
profiles:
|
|
- cicd
|
|
build:
|
|
context: ../provisioning-server
|
|
dockerfile: Dockerfile
|
|
container_name: provisioning-api-server
|
|
ports:
|
|
- "${API_SERVER_PORT:-8083}:8083"
|
|
environment:
|
|
- RUST_LOG=${API_SERVER_LOG_LEVEL:-info}
|
|
- SERVER_HOST=${API_SERVER_HOST:-0.0.0.0}
|
|
- SERVER_PORT=8083
|
|
- JWT_SECRET=${API_SERVER_JWT_SECRET}
|
|
- ORCHESTRATOR_URL=http://orchestrator:8080
|
|
- CONTROL_CENTER_URL=http://control-center:8081
|
|
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
|
volumes:
|
|
- api-server-data:/app/data
|
|
- api-server-logs:/var/log/api-server
|
|
depends_on:
|
|
orchestrator:
|
|
condition: service_healthy
|
|
control-center:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8083/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
networks:
|
|
- provisioning-net-frontend
|
|
- provisioning-net-backend
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '${API_SERVER_CPU_LIMIT:-1000m}'
|
|
memory: ${API_SERVER_MEMORY_LIMIT:-1024M}
|
|
|
|
# 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:
|
|
api-server-data:
|
|
driver: local
|
|
api-server-logs:
|
|
driver: local
|
|
jenkins-data:
|
|
driver: local
|
|
gitlab-runner-config:
|
|
driver: local
|
|
|
|
networks:
|
|
provisioning-net-frontend:
|
|
driver: bridge
|
|
provisioning-net-backend:
|
|
driver: bridge
|