version: '3.8'
services:
  router:
    build:
      context: ./services/router
      dockerfile: Dockerfile
    container_name: dagi-router-node1
    ports:
    - 9102:8000
    environment:
    - NATS_URL=nats://nats:4222
    - ROUTER_CONFIG_PATH=/app/router_config.yaml
    - LOG_LEVEL=info
    - NODE_ID=node-1-hetzner-gex44
    - MEMORY_SERVICE_URL=http://memory-service:8000
    - QDRANT_HOST=qdrant
    - QDRANT_PORT=6333
    - QDRANT_ENABLED=true
    - NEO4J_BOLT_URL=bolt://neo4j:7687
    - NEO4J_HTTP_URL=http://neo4j:7474
    - NEO4J_USER=neo4j
    - NEO4J_PASSWORD=DaarionNeo4j2026!
    - DEEPSEEK_API_KEY=sk-0db94e8193ec4a6e9acd593ee8d898e7
    - MISTRAL_API_KEY=40Gwjo8nVBx4i4vIkgszvXw9bOwDOu4G
    - COHERE_API_KEY=nOdOXnuepLku2ipJWpe6acWgAsJCsDhMO0RnaEJB
    - GROK_API_KEY=xai-69zEnDse8qRuQyZATs9jVKgfwdyvkHzgEVrTbV0OTAurZqsjHmvGepXG6H9GhVRYEC7E4NFl6iZeG0ww
    - VISION_ENCODER_URL=http://vision-encoder:8001
    - SWAPPER_SERVICE_URL=http://swapper-service:8890
    - IMAGE_GEN_URL=http://swapper-service:8890/image/generate
    - STT_SERVICE_URL=http://swapper-service:8890
    - STT_SERVICE_UPLOAD_URL=http://swapper-service:8890/stt
    - OCR_SERVICE_URL=http://swapper-service:8890
    - WEB_SEARCH_SERVICE_URL=http://swapper-service:8890
    - CREWAI_URL=http://dagi-staging-crewai-service:9010
    - CREWAI_ENABLED=true
    - CREWAI_ROUTING_ENABLED=true
    - CREWAI_AGENTS_PATH=/app/config/crewai_agents.json
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./services/router/router_config.yaml:/app/router_config.yaml:ro
    - ./services/router/router-config.yml:/app/router-config.yml:ro
    - ./logs:/app/logs
    - ./config/crewai_agents.json:/app/config/crewai_agents.json:ro
    - ./services/crewai-service/app/config/crewai_teams.yml:/app/config/crewai_teams.yml:ro
    networks:
      dagi-network:
        aliases:
        - router
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s
  swapper-service:
    build:
      context: ./services/swapper-service
      dockerfile: Dockerfile
    container_name: swapper-service-node1
    ports:
    - 8890:8890
    - 8891:8891
    environment:
    - OLLAMA_BASE_URL=http://172.18.0.1:11434
    - SWAPPER_CONFIG_PATH=/app/config/swapper_config.yaml
    - SWAPPER_MODE=single-active
    - MAX_CONCURRENT_MODELS=2
    - MODEL_SWAP_TIMEOUT=300
    - GPU_ENABLED=true
    - NODE_ID=node-1-hetzner-gex44
    - HF_HOME=/root/.cache/huggingface
    - CUDA_VISIBLE_DEVICES=0
    - CRAWL4AI_URL=http://crawl4ai:11235
    - GROK_API_KEY=xai-69zEnDse8qRuQyZATs9jVKgfwdyvkHzgEVrTbV0OTAurZqsjHmvGepXG6H9GhVRYEC7E4NFl6iZeG0ww
    - MISTRAL_API_KEY=40Gwjo8nVBx4i4vIkgszvXw9bOwDOu4G
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./services/swapper-service/config/swapper_config_node1.yaml:/app/config/swapper_config.yaml:ro
    - ./logs:/app/logs
    - swapper-hf-cache-node1:/root/.cache/huggingface
    deploy:
      resources:
        reservations:
          devices:
          - driver: nvidia
            count: 1
            capabilities:
            - gpu
    networks:
    - dagi-network
    restart: unless-stopped
    extra_hosts:
    - host.docker.internal:172.18.0.1
    healthcheck:
      test:
      - CMD-SHELL
      - wget -qO- http://localhost:8890/health || exit 1
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
  crawl4ai:
    image: unclecode/crawl4ai:latest
    container_name: dagi-crawl4ai-node1
    ports:
    - 11235:11235
    environment:
    - CRAWL4AI_API_TOKEN=${CRAWL4AI_API_TOKEN:-}
    - MAX_CONCURRENT_TASKS=5
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD
      - curl
      - -f
      - http://localhost:11235/health
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
  gateway:
    build:
      context: ./gateway-bot
      dockerfile: Dockerfile
    container_name: dagi-gateway-node1
    ports:
    - 9300:9300
    environment:
    - PYTHONPATH=/opt/microdao-daarion:/opt/microdao-daarion/packages/agromatrix-tools
    - AGX_OPERATOR_IDS=1642840513
    - AGX_OPERATOR_CHAT_ID=-1003529715973
    - ROUTER_URL=${ROUTER_URL:-http://router:8000}
    - SERVICE_ID=gateway
    - SERVICE_ROLE=gateway
    - BRAND_INTAKE_URL=http://brand-intake:9211
    - BRAND_REGISTRY_URL=http://brand-registry:9210
    - ENABLE_BRAND_COMMANDS=true
    - PRESENTATION_RENDERER_URL=http://presentation-renderer:9212
    - ARTIFACT_REGISTRY_URL=http://artifact-registry:9220
    - HELION_TELEGRAM_BOT_TOKEN=8112062582:AAGS-HwRLEI269lDutLtAJTFArsIq31YNhE
    - HELION_NAME=Helion
    - HELION_PROMPT_PATH=/app/gateway-bot/helion_prompt.txt
    - NUTRA_TELEGRAM_BOT_TOKEN=8517315428:AAGTLcKxBAZDsMgx28agKTvl1SqJGi0utH4
    - NUTRA_NAME=NUTRA
    - AGROMATRIX_TELEGRAM_BOT_TOKEN=8580290441:AAFuDBmFJtpl-3I_WfkH7Hkb59X0fhYNMOE
    - AGROMATRIX_NAME=AgroMatrix
    - AGROMATRIX_PROMPT_PATH=/app/gateway-bot/agromatrix_prompt.txt
    - ALATEYA_TELEGRAM_BOT_TOKEN=8436880945:AAEi-HS6GEctddoqBUd37MHfweZQP-OjRlo
    - ALATEYA_NAME=Alateya
    - ALATEYA_PROMPT_PATH=/app/gateway-bot/alateya_prompt.txt
    - CLAN_TELEGRAM_BOT_TOKEN=8516872152:AAHH26wU8hJZJbSCJXb4vbmPmakTP77ok5E
    - CLAN_NAME=Spirit
    - CLAN_PROMPT_PATH=/app/gateway-bot/clan_prompt.txt
    - EONARCH_TELEGRAM_BOT_TOKEN=7962391584:AAFYkelLRG3VR_Lxuu6pEGG76t4vZdANtz4
    - DAARWIZZ_TELEGRAM_BOT_TOKEN=8323412397:AAGZbAR22LuOiGD8xVC3OXMjahQ8rs2lJwo
    - DAARWIZZ_NAME=DAARWIZZ
    - DRUID_TELEGRAM_BOT_TOKEN=8145618489:AAFR714mBsNmiuF-rjCw-295iORBReJQZ70
    - DRUID_NAME=DRUID
    - GREENFOOD_TELEGRAM_BOT_TOKEN=7495165343:AAGR1XEOzg7DkPFPCzL_eYLCJfxJuonCxug
    - GREENFOOD_NAME=GREENFOOD
    - SENPAI_TELEGRAM_BOT_TOKEN=8510265026:AAGFrFBIIEihsLptZSxuKdmW2RoRPQDY9FE
    - SOUL_TELEGRAM_BOT_TOKEN=8041596416:AAHhpfCtY8paCm_9AD-4stJJg-Vw-CBf6Qk
    - YAROMIR_TELEGRAM_BOT_TOKEN=8128180674:AAGNZdG3LwECI4z_803smsuRHsK3nPdjMLY
    - SOFIIA_TELEGRAM_BOT_TOKEN=8589292566:AAEmPvS6nY9e-Y-TZm04CAHWlaFnWVxajE4
    - SOFIIA_NAME=Sophia
    - SOUL_NAME=Athena
    - SENPAI_NAME=SENPAI
    - SENPAI_PROMPT_PATH=/app/gateway-bot/senpai_prompt.txt
    - EONARCH_NAME=EONARCH
    - EONARCH_PROMPT_PATH=/app/gateway-bot/eonarch_prompt.txt
    - MEMORY_SERVICE_URL=http://memory-service:8000
    - SWAPPER_SERVICE_URL=http://swapper-service:8890
    - IMAGE_GEN_URL=http://swapper-service:8890/image/generate
    - STT_SERVICE_URL=http://swapper-service:8890
    - STT_SERVICE_UPLOAD_URL=http://swapper-service:8890/stt
    - OCR_SERVICE_URL=http://swapper-service:8890
    - WEB_SEARCH_SERVICE_URL=http://swapper-service:8890
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./gateway-bot:/app/gateway-bot:ro
    - ./logs:/app/logs
    depends_on:
    - router
    - memory-service
    networks:
      dagi-network:
        aliases:
        - gateway
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:9300/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
  nats:
    image: nats:2.10-alpine
    container_name: dagi-nats-node1
    ports:
    - 4222:4222
    command:
    - -js
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - nats-data-node1:/data
    networks:
      dagi-network:
        aliases:
        - nats
    restart: unless-stopped
  minio:
    image: minio/minio:latest
    container_name: dagi-minio-node1
    ports:
    - 9000:9000
    - 9001:9001
    environment:
    - MINIO_ROOT_USER=minioadmin
    - MINIO_ROOT_PASSWORD=minioadmin
    command:
    - server
    - /data
    - --console-address
    - :9001
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - minio-data-node1:/data
    networks:
    - dagi-network
    restart: unless-stopped
  artifact-registry:
    build:
      context: ./services/artifact-registry
      dockerfile: Dockerfile
    container_name: artifact-registry-node1
    ports:
    - 9220:9220
    environment:
    - POSTGRES_HOST=dagi-postgres
    - POSTGRES_PORT=5432
    - POSTGRES_USER=daarion
    - POSTGRES_PASSWORD=DaarionDB2026!
    - POSTGRES_DB=daarion_main
    - MINIO_ENDPOINT=minio:9000
    - MINIO_ACCESS_KEY=minioadmin
    - MINIO_SECRET_KEY=minioadmin
    - MINIO_BUCKET=artifacts
    - MINIO_SECURE=false
    - NATS_URL=nats://nats:4222
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./logs:/app/logs
    depends_on:
    - nats
    - minio
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:9220/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
  rag-service:
    build:
      context: ./services/rag-service
      dockerfile: Dockerfile
    container_name: rag-service-node1
    ports:
    - 9500:9500
    environment:
    - PG_DSN=postgresql+psycopg2://daarion:DaarionDB2026!@dagi-postgres:5432/rag
    - RAG_TABLE_NAME=rag_documents
    depends_on:
    - dagi-postgres
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD
      - wget
      - -qO-
      - http://localhost:9500/health
      interval: 10s
      timeout: 3s
      retries: 10
  render-pptx-worker:
    build:
      context: ./services/render-pptx-worker
      dockerfile: Dockerfile
    container_name: render-pptx-worker-node1
    environment:
    - NATS_URL=nats://nats:4222
    - ARTIFACT_REGISTRY_URL=http://artifact-registry:9220
    - MINIO_ENDPOINT=minio:9000
    - MINIO_ACCESS_KEY=minioadmin
    - MINIO_SECRET_KEY=minioadmin
    - MINIO_BUCKET=artifacts
    - MINIO_SECURE=false
    depends_on:
    - nats
    - artifact-registry
    - minio
    networks:
    - dagi-network
    restart: unless-stopped
  render-pdf-worker:
    build:
      context: ./services/render-pdf-worker
      dockerfile: Dockerfile
    container_name: render-pdf-worker-node1
    environment:
    - NATS_URL=nats://nats:4222
    - ARTIFACT_REGISTRY_URL=http://artifact-registry:9220
    - MINIO_ENDPOINT=minio:9000
    - MINIO_ACCESS_KEY=minioadmin
    - MINIO_SECRET_KEY=minioadmin
    - MINIO_BUCKET=artifacts
    - MINIO_SECURE=false
    depends_on:
    - nats
    - artifact-registry
    - minio
    networks:
    - dagi-network
    restart: unless-stopped
  index-doc-worker:
    build:
      context: ./services/index-doc-worker
      dockerfile: Dockerfile
    container_name: index-doc-worker-node1
    environment:
    - NATS_URL=nats://nats:4222
    - ARTIFACT_REGISTRY_URL=http://artifact-registry:9220
    - RAG_SERVICE_URL=http://rag-service:9500
    - MINIO_ENDPOINT=minio:9000
    - MINIO_ACCESS_KEY=minioadmin
    - MINIO_SECRET_KEY=minioadmin
    - MINIO_BUCKET=artifacts
    - MINIO_SECURE=false
    - INDEX_DOC_MAX_BYTES=52428800
    depends_on:
    - nats
    - artifact-registry
    - rag-service
    - minio
    networks:
    - dagi-network
    restart: unless-stopped
  brand-registry:
    build:
      context: ./services/brand-registry
      dockerfile: Dockerfile
    container_name: brand-registry-node1
    ports:
    - 9210:9210
    environment:
    - BRAND_REGISTRY_DATA=/data/brand-registry
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./logs:/app/logs
    - brand-registry-data-node1:/data/brand-registry
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:9210/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
  brand-intake:
    build:
      context: ./services/brand-intake
      dockerfile: Dockerfile
    container_name: brand-intake-node1
    ports:
    - 9211:9211
    environment:
    - BRAND_MAP_PATH=/app/config/BrandMap.yaml
    - BRAND_INTAKE_DATA=/data/brand-intake
    - BRAND_REGISTRY_URL=http://brand-registry:9210
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./config/brand/BrandMap.yaml:/app/config/BrandMap.yaml:ro
    - ./logs:/app/logs
    - brand-intake-data-node1:/data/brand-intake
    depends_on:
    - brand-registry
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:9211/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
  presentation-renderer:
    build:
      context: ./services/presentation-renderer
      dockerfile: Dockerfile
    container_name: presentation-renderer-node1
    ports:
    - 9212:9212
    environment:
    - BRAND_REGISTRY_URL=http://brand-registry:9210
    - PRESENTATION_DATA=/data/presentations
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./logs:/app/logs
    - presentation-data-node1:/data/presentations
    depends_on:
    - brand-registry
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:9212/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
  memory-service:
    build:
      context: ./services/memory-service
      dockerfile: Dockerfile
    container_name: dagi-memory-service-node1
    ports:
    - 8000:8000
    environment:
    - MEMORY_POSTGRES_HOST=dagi-postgres
    - MEMORY_POSTGRES_PORT=5432
    - MEMORY_POSTGRES_USER=daarion
    - MEMORY_POSTGRES_PASSWORD=DaarionDB2026!
    - MEMORY_POSTGRES_DB=daarion_memory
    - MEMORY_QDRANT_HOST=qdrant
    - MEMORY_QDRANT_PORT=6333
    - MEMORY_COHERE_API_KEY=nOdOXnuepLku2ipJWpe6acWgAsJCsDhMO0RnaEJB
    - MEMORY_DEBUG=false
    - MEMORY_DEEPSEEK_API_KEY=sk-0db94e8193ec4a6e9acd593ee8d898e7
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./logs:/app/logs
    depends_on:
    - qdrant
    networks:
      dagi-network:
        aliases:
        - memory-service
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
  dagi-postgres:
    image: pgvector/pgvector:pg16
    container_name: dagi-postgres
    ports:
    - 5432:5432
    environment:
    - POSTGRES_USER=daarion
    - POSTGRES_PASSWORD=DaarionDB2026!
    - POSTGRES_DB=daarion_main
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - postgres_data_node1:/var/lib/postgresql/data
    networks:
    - dagi-network
    restart: unless-stopped
  qdrant:
    image: qdrant/qdrant:v1.7.4
    container_name: dagi-qdrant-node1
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
    ports:
    - 6333:6333
    - 6334:6334
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - qdrant-data-node1:/qdrant/storage
    networks:
      dagi-network:
        aliases:
        - qdrant
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - wget -qO- http://localhost:6333/healthz || exit 1
      interval: 30s
      timeout: 10s
      retries: 3
  neo4j:
    image: neo4j:5.15-community
    container_name: dagi-neo4j-node1
    ports:
    - 7474:7474
    - 7687:7687
    environment:
    - NEO4J_AUTH=neo4j/DaarionNeo4j2026!
    - NEO4J_PLUGINS=["apoc"]
    - NEO4J_dbms_memory_heap_initial__size=512m
    - NEO4J_dbms_memory_heap_max__size=2G
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - neo4j-data-node1:/data
    - neo4j-logs-node1:/logs
    networks:
      dagi-network:
        aliases:
        - neo4j
    restart: unless-stopped
    healthcheck:
      test:
      - CMD
      - wget
      - --no-verbose
      - --tries=1
      - --spider
      - http://localhost:7474
      interval: 30s
      timeout: 10s
      retries: 3
  redis:
    image: redis:7-alpine
    container_name: dagi-redis-node1
    ports:
    - 6379:6379
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - redis-data-node1:/data
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD
      - redis-cli
      - PING
      interval: 30s
      timeout: 5s
      retries: 3
  vision-encoder:
    build:
      context: ./services/vision-encoder
      dockerfile: Dockerfile
    container_name: dagi-vision-encoder-node1
    ports:
    - 8001:8001
    environment:
    - DEVICE=cpu
    - MODEL_NAME=${VISION_MODEL_NAME:-ViT-L-14}
    - MODEL_PRETRAINED=${VISION_MODEL_PRETRAINED:-openai}
    - NORMALIZE_EMBEDDINGS=true
    - QDRANT_HOST=qdrant
    - QDRANT_PORT=6333
    - QDRANT_ENABLED=true
    volumes:
    - /opt/microdao-daarion/crews:/opt/microdao-daarion/crews:ro
    - /opt/microdao-daarion/packages:/opt/microdao-daarion/packages:ro
    - /opt/microdao-daarion/data:/opt/microdao-daarion/data:ro
    - ./logs:/app/logs
    - vision-model-cache-node1:/root/.cache/clip
    depends_on:
    - qdrant
    networks:
    - dagi-network
    restart: unless-stopped
    healthcheck:
      test:
      - CMD-SHELL
      - python -c "import urllib.request; urllib.request.urlopen('http://localhost:8001/health')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
  market-data-service:
    container_name: dagi-market-data-node1
    restart: unless-stopped
    build:
      context: ./services/market-data-service
      dockerfile: Dockerfile
    environment:
      - BINANCE_WS_URL=wss://stream.binance.com:9443/ws
      - BYBIT_WS_URL=wss://stream.bybit.com/v5/public/spot
      - ALPACA_DRY_RUN=true
      - SQLITE_URL=sqlite+aiosqlite:////data/market_data.db
      - JSONL_PATH=/data/events.jsonl
      - HTTP_HOST=0.0.0.0
      - HTTP_PORT=8891
      - NATS_URL=nats://nats:4222
      - NATS_ENABLED=true
      - NATS_SUBJECT_PREFIX=md.events
      - LOG_LEVEL=INFO
      - LOG_SAMPLE_RATE=500
    ports:
      - "8893:8891"
    volumes:
      - market-data-node1:/data
    networks:
      - dagi-network
    depends_on:
      - nats
    command: ["run", "--provider", "binance,bybit", "--symbols", "BTCUSDT,ETHUSDT"]
    healthcheck:
      test:
        - CMD-SHELL
        - python -c "import urllib.request; urllib.request.urlopen('http://localhost:8891/health')"
      interval: 15s
      timeout: 5s
      retries: 5
      start_period: 30s
  senpai-md-consumer:
    container_name: dagi-senpai-md-consumer-node1
    restart: unless-stopped
    build:
      context: ./services/senpai-md-consumer
      dockerfile: Dockerfile
    environment:
      - NATS_URL=nats://nats:4222
      - NATS_SUBJECT=md.events.>
      - NATS_QUEUE_GROUP=senpai-md
      - FEATURES_ENABLED=true
      - FEATURES_PUB_RATE_HZ=10
      - FEATURES_PUB_SUBJECT=senpai.features
      - SIGNALS_PUB_SUBJECT=senpai.signals
      - ALERTS_PUB_SUBJECT=senpai.alerts
      - LOG_LEVEL=INFO
      - HTTP_PORT=8892
    ports:
      - "8892:8892"
    networks:
      - dagi-network
    depends_on:
      nats:
        condition: service_started
      market-data-service:
        condition: service_healthy
    healthcheck:
      test:
        - CMD-SHELL
        - python -c "import urllib.request; urllib.request.urlopen('http://localhost:8892/health')"
      interval: 15s
      timeout: 10s
      retries: 5
      start_period: 15s
volumes:
  qdrant-data-node1: null
  neo4j-data-node1: null
  neo4j-logs-node1: null
  redis-data-node1: null
  vision-model-cache-node1: null
  docling-model-cache-node1: null
  swapper-hf-cache-node1: null
  brand-registry-data-node1: null
  brand-intake-data-node1: null
  presentation-data-node1: null
  nats-data-node1: null
  minio-data-node1: null
  postgres_data_node1: null
  market-data-node1: null
networks:
  dagi-network:
    external: true
