version: "3.9" # ============================================================================ # DAARION All-in-One Gateway # HTTP Gateway з path-based routing для локальної інфраструктури # ============================================================================ networks: infra_net: driver: bridge volumes: postgres_data: redis_data: nats_data: matrix_data: services: # ========================================================================== # GATEWAY (NGINX) # ========================================================================== gateway-nginx: image: nginx:1.27-alpine container_name: gateway-nginx ports: - "8080:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro depends_on: - microdao-api - microdao-ws - grafana - prometheus - rag-service - notification-service - matrix-homeserver networks: - infra_net healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost/healthz"] interval: 30s timeout: 10s retries: 3 restart: unless-stopped # ========================================================================== # INFRASTRUCTURE # ========================================================================== postgres: image: postgres:15-alpine container_name: daarion-postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} POSTGRES_DB: daarion volumes: - postgres_data:/var/lib/postgresql/data networks: - infra_net healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped redis: image: redis:7-alpine container_name: daarion-redis volumes: - redis_data:/data networks: - infra_net healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 restart: unless-stopped nats: image: nats:latest container_name: daarion-nats command: "--jetstream --store_dir=/data" volumes: - nats_data:/data networks: - infra_net healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"] interval: 5s timeout: 3s retries: 3 restart: unless-stopped # ========================================================================== # MICRODAO SERVICES # ========================================================================== microdao-api: image: microdao-api:local container_name: microdao-api # build: # context: ../../ # dockerfile: services/microdao-service/Dockerfile environment: - APP_ENV=local - PORT=8000 - DATABASE_URL=${DATABASE_URL} - REDIS_URL=${REDIS_URL} - NATS_URL=${NATS_URL} networks: - infra_net depends_on: postgres: condition: service_healthy redis: condition: service_healthy nats: condition: service_healthy restart: unless-stopped microdao-ws: image: microdao-ws:local container_name: microdao-ws # build: # context: ../../ # dockerfile: services/messaging-service/Dockerfile environment: - APP_ENV=local - PORT=8001 - NATS_URL=${NATS_URL} - REDIS_URL=${REDIS_URL} networks: - infra_net depends_on: nats: condition: service_healthy redis: condition: service_healthy restart: unless-stopped # ========================================================================== # MATRIX # ========================================================================== matrix-homeserver: image: matrixdotorg/synapse:latest container_name: matrix-homeserver environment: - SYNAPSE_SERVER_NAME=${SYNAPSE_SERVER_NAME:-localhost} - SYNAPSE_REPORT_STATS=no volumes: - matrix_data:/data networks: - infra_net restart: unless-stopped # ========================================================================== # MONITORING # ========================================================================== grafana: image: grafana/grafana:11.0.0 container_name: grafana environment: - GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s/grafana/ - GF_SERVER_SERVE_FROM_SUB_PATH=true - GF_AUTH_ANONYMOUS_ENABLED=false networks: - infra_net restart: unless-stopped prometheus: image: prom/prometheus:v2.53.0 container_name: prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' - '--web.external-url=/prometheus/' - '--web.route-prefix=/' networks: - infra_net restart: unless-stopped # ========================================================================== # APPLICATION SERVICES # ========================================================================== rag-service: image: rag-service:local container_name: rag-service # build: # context: ../../ # dockerfile: services/rag-service/Dockerfile environment: - APP_ENV=local - PORT=8081 - RAG_MODEL_NAME=${RAG_MODEL_NAME:-BAAI/bge-m3} networks: - infra_net restart: unless-stopped notification-service: image: notification-service:local container_name: notification-service # build: # context: ../../ # dockerfile: services/notification-service/Dockerfile environment: - APP_ENV=local - PORT=8082 - NOTIFY_FROM_EMAIL=${NOTIFY_FROM_EMAIL:-noreply@localhost} networks: - infra_net restart: unless-stopped