Major changes: - Normalize get_node_endpoints to use ENV vars (ROUTER_BASE_URL, SWAPPER_BASE_URL) - Remove node_id-based URL selection logic - Add fallback direct API call in get_node_swapper_detail - Fix Swapper API endpoint (/models instead of /api/v1/models) - Add router_healthy and router_version to node_heartbeat fallback - Add ENV vars to docker-compose for Router/Swapper URLs Documentation: - Add TASK_PHASE_NODE2_ROUTER_SWAPPER_FIX.md with full task description - Add NODE2_GUARDIAN_SETUP.md with setup instructions This fixes: - Swapper models not showing for NODE1 and NODE2 - DAGI Router agents not showing for NODE2 - Router/Swapper showing as Down/Degraded when they're actually up
151 lines
4.3 KiB
YAML
151 lines
4.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# ============================================================================
|
|
# City Service (Production-ready)
|
|
# ============================================================================
|
|
city-service:
|
|
build:
|
|
context: ./services/city-service
|
|
dockerfile: Dockerfile
|
|
container_name: daarion-city-service
|
|
ports:
|
|
- "7001:7001"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- LOG_LEVEL=INFO
|
|
- ENVIRONMENT=production
|
|
- DATABASE_URL=postgresql://postgres:postgres@daarion-postgres:5432/daarion
|
|
- MATRIX_GATEWAY_URL=http://gateway:9300
|
|
- NATS_URL=nats://dagi-nats:4222
|
|
# MinIO configuration (from .env)
|
|
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-http://minio:9000}
|
|
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-assets-admin}
|
|
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
|
|
- ASSETS_BUCKET=${ASSETS_BUCKET:-daarion-assets}
|
|
- ASSETS_PUBLIC_BASE_URL=${ASSETS_PUBLIC_BASE_URL:-https://assets.daarion.space/daarion-assets}
|
|
# DAGI Router & Swapper configuration (from .env)
|
|
- ROUTER_BASE_URL=${ROUTER_BASE_URL:-http://dagi-router:9102}
|
|
- SWAPPER_BASE_URL=${SWAPPER_BASE_URL:-http://swapper-service:8890}
|
|
depends_on:
|
|
- dagi-postgres
|
|
- dagi-nats
|
|
networks:
|
|
- daarion-network
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:7001/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# ============================================================================
|
|
# Space Service
|
|
# ============================================================================
|
|
space-service:
|
|
build:
|
|
context: ./services/space-service
|
|
dockerfile: Dockerfile
|
|
container_name: daarion-space-service
|
|
ports:
|
|
- "7002:7002"
|
|
environment:
|
|
- LOG_LEVEL=INFO
|
|
- ENVIRONMENT=development
|
|
# TODO: додати з'єднання з Redis, NATS
|
|
# - REDIS_URL=redis://redis:6379
|
|
# - NATS_URL=nats://nats:4222
|
|
networks:
|
|
- daarion-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:7002/health')"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# ============================================================================
|
|
# Nginx Reverse Proxy (для єдиної точки входу)
|
|
# ============================================================================
|
|
api-gateway:
|
|
image: nginx:alpine
|
|
container_name: daarion-api-gateway
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
- ./nginx/api-gateway.conf:/etc/nginx/nginx.conf:ro
|
|
networks:
|
|
- daarion-network
|
|
depends_on:
|
|
- city-service
|
|
- space-service
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
# ============================================================================
|
|
# External Services (from main docker-compose.yml)
|
|
# ============================================================================
|
|
dagi-postgres:
|
|
image: postgres:15-alpine
|
|
container_name: dagi-postgres
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=daarion
|
|
volumes:
|
|
- microdao-daarion_postgres_data:/var/lib/postgresql/data
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
dagi-nats:
|
|
image: nats:2.10-alpine
|
|
container_name: dagi-nats
|
|
ports:
|
|
- "4222:4222"
|
|
- "8222:8222"
|
|
command: ["--jetstream", "--store_dir=/data", "-m", "8222"]
|
|
volumes:
|
|
- nats-data:/data
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:8222/healthz"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
volumes:
|
|
microdao-daarion_postgres_data:
|
|
external: true
|
|
nats-data:
|
|
driver: local
|
|
|
|
networks:
|
|
daarion-network:
|
|
name: daarion-network
|
|
driver: bridge
|
|
dagi-network:
|
|
external: true
|
|
|
|
|
|
|
|
|
|
|