version: '3.8' services: # Infrastructure services postgres: image: postgres:16 environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: chronos ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 redis: image: redis:7 ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 zookeeper: image: confluentinc/cp-zookeeper:7.3.0 environment: ZOOKEEPER_CLIENT_PORT: 2181 ZOOKEEPER_TICK_TIME: 2000 ports: - "2181:2181" kafka: image: confluentinc/cp-kafka:7.3.0 depends_on: - zookeeper ports: - "9092:9092" environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" healthcheck: test: ["CMD", "kafka-topics", "--bootstrap-server", "localhost:9092", "--list"] interval: 10s timeout: 10s retries: 5 # Chronos microservices scheduler: build: context: ./scheduler dockerfile: Dockerfile depends_on: kafka: condition: service_healthy postgres: condition: service_healthy environment: DATABASE_URL: postgres://postgres:postgres@postgres:5432/chronos KAFKA_BROKERS: kafka:29092 KAFKA_TOPIC: chronos-workflows PORT: 8080 ports: - "8080:8080" volumes: - ./scheduler:/app command: ["go", "run", "main.go"] executor: build: context: ./executor dockerfile: Dockerfile depends_on: kafka: condition: service_healthy redis: condition: service_healthy environment: KAFKA_BROKERS: kafka:29092 KAFKA_TOPIC_IN: chronos-workflows KAFKA_TOPIC_OUT: chronos-tasks REDIS_URL: redis://redis:6379/0 PORT: 8081 ports: - "8081:8081" volumes: - ./executor:/app command: ["go", "run", "main.go"] durable-engine: build: context: ./durable-engine dockerfile: Dockerfile depends_on: kafka: condition: service_healthy postgres: condition: service_healthy environment: DATABASE_URL: postgres://postgres:postgres@postgres:5432/chronos KAFKA_BROKERS: kafka:29092 KAFKA_TOPIC: chronos-tasks KAFKA_GROUP_ID: chronos-durable-engine PORT: 50051 ports: - "50051:50051" volumes: - ./durable-engine:/app worker-pool: build: context: ./worker-pool dockerfile: Dockerfile depends_on: - durable-engine environment: DURABLE_ENGINE_URL: durable-engine:50051 PORT: 8082 ports: - "8082:8082" volumes: - ./worker-pool:/app command: ["go", "run", "main.go"] observatory: build: context: ./observatory dockerfile: Dockerfile depends_on: - scheduler - executor - durable-engine - worker-pool environment: PORT: 8083 ports: - "8083:8083" - "9090:9090" # Prometheus metrics volumes: - ./observatory:/app command: ["go", "run", "main.go"] # Observability tools prometheus: image: prom/prometheus:v2.44.0 ports: - "9091:9090" volumes: - ./observatory/prometheus.yml:/etc/prometheus/prometheus.yml - prometheus_data:/prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' grafana: image: grafana/grafana:9.5.2 ports: - "3000:3000" volumes: - grafana_data:/var/lib/grafana environment: - GF_SECURITY_ADMIN_PASSWORD=admin - GF_USERS_ALLOW_SIGN_UP=false depends_on: - prometheus jaeger: image: jaegertracing/all-in-one:1.45 ports: - "16686:16686" # UI - "14268:14268" # Collector HTTP - "4317:4317" # OTLP gRPC - "4318:4318" # OTLP HTTP volumes: postgres_data: redis_data: prometheus_data: grafana_data: