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