xarvionex-core / docker-compose.yml
root
first commit
de15ca4
version: '3.8'
# =================================================================
# XARVIONEX ORGANISM TOPOLOGY
# Canonical Source of Truth for Infrastructure
# =================================================================
# --- NETWORK DEFINITION ---
# Sistem saraf digital privat. Organ berkomunikasi lewat nama service.
networks:
xar-net:
driver: bridge
# --- PERSISTENCE DEFINITION ---
# Volume data dipetakan langsung ke filesystem host (.data/)
# Ini memudahkan backup/restore tanpa docker commands yang rumit.
volumes:
pg_data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/.data/postgres
redis_data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/.data/redis
services:
# ==========================================
# 1. LONG TERM MEMORY (Database)
# ==========================================
db:
image: postgres:15-alpine
container_name: xar-memory
restart: always
env_file: .env
volumes:
- pg_data:/var/lib/postgresql/data
# Schema Injection: Memastikan struktur otak terbentuk saat lahir
- ./memory/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- xar-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
# ==========================================
# 2. SPINAL CORD (Message Bus)
# ==========================================
redis:
image: redis:7-alpine
container_name: xar-spinal-cord
restart: always
volumes:
- redis_data:/data
networks:
- xar-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ==========================================
# 3. BRAIN CORE (Ingress API)
# ==========================================
core-api:
build:
context: ./core
dockerfile: Dockerfile
container_name: xar-brain
restart: always
depends_on:
redis:
condition: service_healthy
ports:
- "8000:8000"
env_file: .env
networks:
- xar-net
# ==========================================
# 4. METABOLISM (Async Worker)
# ==========================================
worker:
build:
context: ./workers/biocore-worker
dockerfile: Dockerfile
container_name: xar-metabolism
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file: .env
networks:
- xar-net
# ==========================================
# 5. ADAPTER: VEXA BRIDGE (Digestion)
# ==========================================
vexa-bridge:
build:
context: ./adapters/vexa-bridge
dockerfile: Dockerfile
container_name: xar-organ-vexa
restart: unless-stopped
ports:
- "5000:5000"
env_file: .env
networks:
- xar-net
# ==========================================
# 6. ADAPTER: SENSORY BRIDGE (Hearing)
# ==========================================
sensory-bridge:
build:
context: ./adapters/sensory-bridge
dockerfile: Dockerfile
container_name: xar-organ-sensory
restart: unless-stopped
# Tanpa ports mapping karena ini adalah Client (Long Polling)
env_file: .env
networks:
- xar-net