# Use CentOS 7 as base image
FROM centos:7 

# Install epel repo
RUN yum update -y && yum -y install epel-release

# Install make, nano, openssh, wget, rsync and cronie
RUN yum -y install make nano openssh-clients wget rsync cronie

# Install python 3.9.5
RUN yum -y install gcc openssl-devel bzip2-devel libffi-devel zlib-devel && \
    wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz && \
    tar xzf Python-3.9.5.tgz && \
    cd Python-3.9.5 && \
    ./configure --enable-optimizations && \
    make altinstall && cd .. && rm Python-3.9.5.tgz
    
# Install redis, psycopg2, paramiko, scp, tabulate Python packages
RUN pip3.9 install --no-cache-dir redis psycopg2-binary paramiko scp tabulate
