FROM centos:centos7

# specific conda environment file to use
ARG conda_environment=environment_37.yml

RUN yum -y update \
    && yum -y install epel-release \
    && yum -y install git curl bzip2 texlive-xetex pandoc gcc gcc-c++ python-pip \
    && curl -sSL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh \
    && bash /tmp/miniconda.sh -bfp /usr/local/ \
    && rm -rf /tmp/miniconda.sh \
    && conda update conda \
    && conda clean --all --yes \
    && rpm -e --nodeps curl bzip2 \
    && yum clean all

COPY . .

RUN conda update --quiet conda

RUN conda env update --quiet -n root -f $conda_environment

RUN jupyter labextension install ipyvolume jupyter-leaflet jupyter-threejs @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-sidecar

EXPOSE 8899