version: "3.8"

services:
  # ── Backend Django (Python) ───────────────────────────
  backend:
    build:
      context: ./crm_dreinet
      dockerfile: Dockerfile
    container_name: crm_dreinet_back_demo
    ports:
      - "8022:8020"
    volumes:
      - ./crm_dreinet:/app
    env_file:
      - ./crm_dreinet/.env
    environment:
      - DJANGO_SETTINGS_MODULE=config.settings
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - crm_democrm_network
    restart: unless-stopped

  # ── Frontend Nuxt ─────────────────────────────────────
  frontend:
    build:
      context: ./crm_dreinet_front
      dockerfile: Dockerfile
    container_name: crm_dreinet_front_demo
    ports:
      - "3010:3000"
    environment:
      - NUXT_PUBLIC_API_BASE=https://api-democrm.itego.com.ar/api
      - NUXT_PUBLIC_WS_BASE=wss://api-democrm.itego.com.ar
      - NITRO_HOST=0.0.0.0
      - NITRO_PORT=3000
    depends_on:
      - backend
    networks:
      - crm_democrm_network
    restart: unless-stopped

networks:
  crm_democrm_network:
    driver: bridge
