content: FROM python:3.9-slim
  
  WORKDIR /app
  
  # Install system dependencies including C++ compiler and dev tools
  RUN apt-get update && apt-get install -y \
      gcc \
      g++ \
      make \
      python3-dev \
      build-essential \
      curl \
      pkg-config \
      git \
      && rm -rf /var/lib/apt/lists/*
  
  # Copy requirements first to leverage Docker cache
  COPY requirements.txt .
  
  # Install Python packages in specific order
  RUN pip install --no-cache-dir --upgrade pip && \
      pip install --no-cache-dir wheel setuptools && \
      pip install --no-cache-dir -r requirements.txt && \
      python -m spacy download en_core_web_sm
  
  # Set Python path
  ENV PYTHONPATH=/app
  