version: '3.9'

# Development override — hot reload for backend, Vite dev server for frontend
# Usage: docker-compose -f docker-compose.yml -f docker-compose.dev.yml up

services:
  postgres:
    ports:
      - "5432:5432"

  backend:
    build:
      target: dev
    volumes:
      - ./backend:/app
      - /app/node_modules
    environment:
      NODE_ENV: development
    command: npm run dev

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile.dev
    ports:
      - "52867:5173"
    volumes:
      - ./frontend:/app
      - /app/node_modules
    environment:
      VITE_API_URL: http://localhost:3001
