FROM fedora:latest

ARG MUSICA_TAG=v0.14.5

RUN dnf -y update \
    && dnf -y install \
        cmake \
        gcc-c++ \
        gcc-fortran \
        gdb \
        git \
        lapack-devel \
        make \
        netcdf-fortran-devel \
        python3 \
        python3-devel \
        python3-pip \
        python3-setuptools \
    && dnf clean all

ENV CXX=g++
ENV CC=gcc
ENV FC=gfortran

RUN git clone https://github.com/NCAR/musica.git /musica \
    && cd /musica \
    && git checkout $MUSICA_TAG

RUN cd /musica \
    && pip3 install .

COPY . /music-box/

RUN cd /music-box \
    && pip3 install --verbose .[dev]

WORKDIR /music-box
CMD ["pytest"]
