FROM centos:centos7

RUN yum -y update
RUN yum install -y gcc
RUN yum install -y libgfortran
RUN yum install -y git

#
# Python 3.6 (pip3 install is enough)
#
# RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm # Seems to be deprecated
RUN yum install -y https://repo.ius.io/ius-release-el7.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install -y python36u python36u-libs python36u-devel python36u-pip

RUN pip3 install numpy
RUN pip3 install pytest
RUN pip3 install pandas
RUN pip3 install spiceypy==2.3.2
RUN pip3 install html-testRunner
RUN pip3 install bs4

COPY . root/arcgen/

# Add arcgen/exe to path
ENV PATH "$PATH:/root/arcgen/arcgen/exe/pc_linux_64bit"

#
# Install ARCGEN
#
WORKDIR /root/arcgen
RUN python3 setup.py build
RUN pip3 install -e .

#
# Run ARCGEN regression tests
#
WORKDIR /root/arcgen/arcgen/tests
RUN python3 test_regression.py

#
# Back to the root
#
WORKDIR /root


