# Integration test container for RNS/LXMF singleton isolation
#
# Each test run gets a fresh container with clean global state.
# No port conflicts, no identity file collisions, no singleton pollution.

FROM python:3.11-slim

WORKDIR /app

# Install system dependencies for RNS
RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc \
    && rm -rf /var/lib/apt/lists/*

# Copy project files
COPY pyproject.toml README.md ./
COPY src/ src/
COPY tests/ tests/
COPY packages/ packages/

# Install package with dev dependencies
RUN pip install --no-cache-dir -e ".[dev]"

# Install internal packages used by integration tests
RUN pip install --no-cache-dir -e packages/styrene-bond-rpc

# Create isolated Reticulum config directory
RUN mkdir -p /root/.reticulum

# Run all tests
CMD ["pytest", "tests/", "-v", "--tb=short"]
