version: '3.9'

# Development override — mounts source for hot-reload, uses local ports
# Usage: docker compose -f docker-compose.yml -f docker-compose.dev.yml up

services:
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    environment:
      - NODE_ENV=development
      - SANDBOX_MODE=true
    volumes:
      - ./backend/src:/app/src
      - backend_temp:/app/temp
      - backend_uploads:/app/uploads
      - backend_models:/app/models
    command: ["npm", "run", "dev"]
    ports:
      - "3001:3001"

  vaas-backend:
    environment:
      - NODE_ENV=development
    volumes:
      - ./idswyft-vaas/vaas-backend/src:/app/src
    command: ["npm", "run", "dev"]

  nginx:
    profiles: ["!dev"]  # Disable nginx in dev (use direct ports)

volumes:
  backend_temp:
  backend_uploads:
  backend_models:
