# Dockerfile for the SRP-HUBO reproducibility artifact.
#
# Produces an image that can rerun every experiment end-to-end and
# ships the Phase-4 library refactor (Solver ABC, conformance harness,
# JSON schemas, srp-hubo-lint/check CLIs, HiGHS/CBC MILP fallback, pytest
# suite).
#
# Build:
#   docker build -t srp-hubo:v2.0 .
#
# Run all experiments (will take ~5.4 core-hours on a laptop):
#   docker run --rm -v "$PWD/results:/work/results" \
#              -v "$PWD/../paper:/paper" srp-hubo:v2.0 \
#              bash scripts/run_all.sh --tqe-full
#
# Run the pytest library suite (< 2s):
#   docker run --rm srp-hubo:v2.0 python -m pytest src/srp_hubo/tests/ -v
#
# Drop into a shell for interactive use:
#   docker run --rm -it srp-hubo:v2.0
FROM python:3.11-slim

LABEL org.opencontainers.image.title="srp-hubo"
LABEL org.opencontainers.image.version="2.0.0"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/ria6683/srp-hubo"

# System deps for matplotlib and scientific Python
RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        gcc \
        libatlas-base-dev \
        libopenblas-dev \
        libstdc++6 \
        git \
        curl \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /work

# Install pinned Python deps before copying source so layer caching is
# effective when source changes but deps don't.
COPY requirements.txt /work/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy source tree
COPY src /work/src
COPY scripts /work/scripts
COPY data /work/data

# Default: drop into bash so the user can inspect or run scripts
CMD ["bash"]
