# Octave runtime for BasisREMY's FID-A / MRSCloud / CustomSLaser backends:
# Octave plus the two Octave-Forge packages the simulators use, nothing else.
# The Python side never runs inside the container — it drives octave-cli
# through the /workspace bind mount (see docker_octave.py).
FROM debian:bookworm-slim

# bump when the image contents change: DockerOctave rebuilds an image whose
# label does not match (that is how the old 16 GB image gets replaced)
LABEL org.basisremy.octave-image="lean-2"

# libopenblas0-pthread replaces Debian's reference BLAS through the
# alternatives system: dense complex products run 5-8x faster (256x256:
# 6.4 -> 1.2 ms, 1024x1024: 414 -> 54 ms on Apple silicon), which is where
# the simulators spend their time.
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        octave \
        octave-signal \
        octave-control \
        libopenblas0-pthread \
        procps \
        ca-certificates && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

# load the packages in every session
RUN octave-cli --no-gui --quiet --eval "pkg load signal control; savepath"

ENV OCTAVE_EXECUTABLE=octave
WORKDIR /workspace
