# Multi-bot: user1 = @ilia, user2 = @family, user3 = @wife (see ~/.nanobot/workspaces/* and scripts/init-agent-workspaces.sh).
# Using separate env files per container:
# - .env.shared: Common settings (API keys, model, etc.) - loaded first
# - .env.user1, .env.user2, .env.user3: Bot-specific overrides - loaded after
# Later files override earlier ones, so bot-specific settings take precedence

services:
  nanobot-user1:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nanobot-user1
    command: ["gateway"]
    restart: unless-stopped
    env_file:
      - .env.shared  # Shared settings (loaded first)
      - .env.user1   # Bot-specific overrides (loaded second, overrides shared)
    volumes:
      - ~/.nanobot-user1:/root/.nanobot
      - ~/.nanobot/workspaces/ilia:/workspace
      # Local-cloned MCP servers (see scripts/setup-mcp-servers.sh)
      - ./mcp-servers:/app/mcp-servers:ro
    ports:
      - "18790:18790"
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 1G
        reservations:
          cpus: '0.25'
          memory: 256M

  nanobot-user2:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nanobot-user2
    command: ["gateway"]
    restart: unless-stopped
    env_file:
      - .env.shared  # Shared settings (loaded first)
      - .env.user2   # Bot-specific overrides (loaded second, overrides shared)
    volumes:
      - ~/.nanobot-user2:/root/.nanobot
      - ~/.nanobot/workspaces/family:/workspace
      - ./mcp-servers:/app/mcp-servers:ro
    ports:
      - "18791:18790"
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 1G
        reservations:
          cpus: '0.25'
          memory: 256M

  nanobot-user3:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nanobot-user3
    command: ["gateway"]
    restart: unless-stopped
    env_file:
      - .env.shared  # Shared settings (loaded first)
      - .env.user3   # Bot-specific overrides (loaded second, overrides shared)
    volumes:
      - ~/.nanobot-user3:/root/.nanobot
      - ~/.nanobot/workspaces/wife:/workspace
      - ./mcp-servers:/app/mcp-servers:ro
    ports:
      - "18792:18790"
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 1G
        reservations:
          cpus: '0.25'
          memory: 256M

