# =============================================================================
# Docker Compose Override for Development
# This file is automatically loaded by docker-compose
# =============================================================================

version: '3.8'

services:
  # Development overrides for web service
  web:
    environment:
      - DEBUG=true
      - LOG_LEVEL=DEBUG
      - SKIP_STARTUP_TEST=false
    
    volumes:
      # Enable hot reload for development
      - ./src:/app/src:ro
      - ./app.py:/app/app.py:ro
      
    # Development command with auto-reload
    command: ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
    
    # Remove resource limits for development
    deploy:
      resources: {}

  # Development MongoDB with exposed logs
  mongodb:
    environment:
      - MONGO_INITDB_ROOT_USERNAME=admin
      - MONGO_INITDB_ROOT_PASSWORD=devpassword
    
    # Remove resource limits for development  
    deploy:
      resources: {}

  # Development Redis with debug logging
  redis:
    command: >
      redis-server
      --save 60 1
      --loglevel debug
      --maxmemory 256mb
      --maxmemory-policy allkeys-lru
      --appendonly no
    
    # Remove resource limits for development
    deploy:
      resources: {}
