#INFORMATION
#MAINTAINER RAVEL Sébastien
#version="1.0"
#software="gratools"
#description="All dependencies used to run test"
#website="https://gratools.readthedocs.io/en/latest/"

FROM ubuntu:24.04
USER root

# ENVIRONMENT

# INSTALL, Global

RUN DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get upgrade -y -qq
RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN apt-get install -y -qq apt-utils dialog
RUN apt-get install -y -qq tzdata
RUN dpkg-reconfigure --frontend noninteractive tzdata
RUN apt-get -y -qq install keyboard-configuration git vim curl wget less locate graphviz python3-pip software-properties-common

# Install for Python
RUN echo 'export LC_ALL=C.UTF-8' >> /environment
RUN echo 'export LANG=C.UTF-8' >> /environment
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN cat /etc/os-release
RUN apt-get update && apt-get -y -qq install python3.12-full

# Install required system packages for Python
RUN apt-get update && apt-get install -y python3.12-full python3.12-venv python3.12-dev build-essential

# Create a virtual environment
RUN python3.12 -m venv /opt/venv

# Ensure the virtual environment is the default Python environment
ENV PATH="/opt/venv/bin:$PATH"

# Upgrade pip and install necessary Python packages
RUN pip install -U --no-cache-dir build setuptools pip docutils

# install bedtools for gratools
RUN apt-get install -y -qq bedtools

# add unzip for test
RUN apt-get install unzip

# clean image tmps
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# installing datatest
RUN mkdir -p /usr/local/gratools/ && cd /usr/local/gratools/ &&  \
    wget --progress=dot:giga http://itrop.ird.fr/GraTools/data-gratools-light.tar.gz && \
    tar -xzf data-gratools-light.tar.gz &&  \
    rm -f data-gratools-light.tar.gz
