FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    curl \
    git \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt* ./
COPY setup.py ./
COPY pyproject.toml ./

# Install Python dependencies
RUN pip install --no-cache-dir -e .

# Install additional development dependencies
RUN pip install --no-cache-dir \
    jupyter \
    notebook \
    ipython \
    pytest \
    black \
    isort \
    mypy

# Copy source code
COPY src/ ./src/
COPY examples/ ./examples/
COPY tests/ ./tests/

# Create notebooks directory
RUN mkdir -p /app/notebooks

# Set environment variables
ENV PYTHONPATH=/app/src
ENV PYTHONUNBUFFERED=1

# Expose Jupyter port (optional)
EXPOSE 8888

# Default command
CMD ["/bin/bash"]