name: canifa-ai-ecosystem

services:
  # ──────────────────────────────────────────────
  # THẰNG CẢ: CANIFA AI STYLIST (Cũ)
  # ──────────────────────────────────────────────
  canifa-backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: canifa_stylist_api
    ports:
      - "5000:5000"
    environment:
      - PORT=5000
    volumes:
      - ./backend:/app  # Hot-reload mapping
    restart: unless-stopped

  # ──────────────────────────────────────────────
  # THẰNG EM 1: CUCCU NOTE BACKEND
  # ──────────────────────────────────────────────
  cuccu-backend:
    build:
      context: ./miniapp/cuccu_note/backend
      dockerfile: Dockerfile.dev
    container_name: cuccu_note_api
    ports:
      - "5001:8000"  # Cổng ra ngoài là 5001, bên trong FastAPI chạy 8000
    environment:
      - PORT=8000
    volumes:
      - ./miniapp/cuccu_note/backend:/app
    restart: unless-stopped

  # ──────────────────────────────────────────────
  # THẰNG EM 2: CUCCU NOTE FRONTEND (React)
  # ──────────────────────────────────────────────
  cuccu-frontend:
    build:
      context: ./miniapp/cuccu_note/frontend
      dockerfile: Dockerfile
    container_name: cuccu_note_ui
    ports:
      - "3000:3000"
    volumes:
      - ./miniapp/cuccu_note/frontend:/app
      - /app/node_modules  # Giữ node_modules bên trong container
    environment:
      - VITE_API_URL=http://localhost:5001  # Trỏ về thằng cuccu-backend
    restart: unless-stopped
    depends_on:
      - cuccu-backend
