# SwarmCare - Development Docker Compose
# Use: docker compose -f docker-compose.dev.yml up
version: '3.8'

services:
  # SwarmCare UI - Next.js Development Server with Hot Reload
  swarmcare-ui-dev:
    build:
      context: .
      dockerfile: Dockerfile.dev
    container_name: swarmcare-ui-dev
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=development
      - NEXT_PUBLIC_API_URL=http://localhost:8000
      - NEXT_PUBLIC_ENABLE_ANALYTICS=true
      - NEXT_PUBLIC_ENABLE_FHIR_INTEGRATION=false
      - WATCHPACK_POLLING=true
    volumes:
      - .:/app
      - /app/node_modules
      - /app/.next
    networks:
      - swarmcare-dev-network

  # PostgreSQL for Development
  postgres-dev:
    image: postgres:16-alpine
    container_name: swarmcare-postgres-dev
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=swarmcare
      - POSTGRES_PASSWORD=swarmcare
      - POSTGRES_DB=swarmcare
    volumes:
      - postgres_dev_data:/var/lib/postgresql/data
    networks:
      - swarmcare-dev-network

  # Redis for Development
  redis-dev:
    image: redis:7-alpine
    container_name: swarmcare-redis-dev
    ports:
      - "6379:6379"
    networks:
      - swarmcare-dev-network

networks:
  swarmcare-dev-network:
    driver: bridge

volumes:
  postgres_dev_data:
