FROM python:3.11-slim

# Install system dependencies including ADB
RUN apt-get update && apt-get install -y \
    android-tools-adb \
    android-tools-fastboot \
    usbutils \
    && rm -rf /var/lib/apt/lists/*

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

# Set working directory
WORKDIR /app

# Copy project files
COPY pyproject.toml uv.lock* ./

# Install dependencies
RUN uv sync --frozen

# Copy source code
COPY src/ ./src/

# Expose ADB server port (optional, mainly for debugging)
EXPOSE 5037

CMD ["uv", "run", "mcadb"]