version: '3.8'

services:
  ai-brain:
    container_name: 100_ai_agents
    build: .
    restart: always  # T? ??ng kh?i ??ng l?i n?u crash ho?c reset server
    ports:
      - "80:8501"    # Ch?y th?ng tr�n c?ng 80 (truy c?p b?ng IP server kh�ng c?n :8501)
    volumes:
      - ./brain_memory:/app/brain_memory  # L?u tr? b? nh? h?c t?p ra ngo�i (?? kh�ng m?t khi update)
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}  # ??c key t? bi?n m�i tr??ng
      - PYTHONUNBUFFERED=1
    deploy:
      resources:
        limits:
          memory: 4G  # Gi?i h?n RAM t?i ?a (T�y server b?n mua)
          cpus: '2.0'