FROM gitlab.beno.ai:4567/eng/external-images/ubuntu:20.04

# apt deps for tf, R and R modules
RUN apt-get update && \
    apt-get -y upgrade && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        apt-transport-https \
        apt-utils \
        bamtools \
        build-essential \
        ca-certificates \
        curl \
        gfortran \
        ghostscript \
        git \
        gnupg1 \
        gnupg2  \
        graphviz \
        libatlas-base-dev \
        libblas-dev \
        libbz2-dev \
        libcurl4-openssl-dev \
        libgraphviz-dev \
        libhdf5-serial-dev \
        libjpeg-turbo8-dev \
        liblapack-dev \
        liblzma-dev \
        libpcre++-dev \
        libpcre2-dev \
        libpng-dev \
        libreadline-dev \
        libsnappy-dev \
        libssh2-1-dev \
        libssl-dev \
        libxml2-dev \
        locales \
        parallel \
        pkg-config \
        samtools \
        software-properties-common \
        ssh \
        tmux \
        vim \
        wget \
        zlib1g-dev

# Locales
RUN locale-gen en_GB.UTF-8
ENV LANG en_GB.UTF-8
ENV LANGUAGE en_GB:en
ENV LC_ALL en_GB.UTF-8

# emacs-nox requires tzdata, which tries to read config form the tty
ENV TZ Europe/London
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
    echo $TZ > /etc/timezone && \
    apt-get update && \
    DEBIAN_FRONTEND=noninteractive\
    apt-get install -y --no-install-recommends \
        emacs-nox

# Python3
RUN apt-get install -y --no-install-recommends \
        python3 \
        python3-dev \
        python3-tk \
        python3-apt \
        python3-distutils \
        python3-pip \
        python3-setuptools \
        python3-software-properties \
        software-properties-common
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
             update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
RUN python --version
RUN pip --version

# Install python dependencies
ADD requirements.txt .
RUN pip3 install --upgrade pip setuptools
RUN pip3 install --no-cache-dir -r requirements.txt
