FROM condaforge/miniforge3:latest

# Prevent Python from loading user site-packages (~/.local) when home dir is bind-mounted
ENV PYTHONNOUSERSITE=1

# Install MRtrix3 and runtime deps via conda-forge
RUN mamba install -y -c conda-forge -c mrtrix3 \
        mrtrix3 libstdcxx-ng python=3.11 \
        numpy pandas scipy pytz \
    && mamba clean -afy

# Upgrade pip then install qsiparc and remaining PyPI deps
WORKDIR /opt/qsiparc
COPY pyproject.toml README.md ./
COPY src/ src/
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir .

# Verify both tools are available
RUN tck2connectome --version && qsiparc --help

ENTRYPOINT ["qsiparc"]
