# 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.4
RUN yum -y install gcc openssl-devel bzip2-devel libffi-devel zlib-devel && \
    wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz && \
    tar xzf Python-3.9.4.tgz && \
    cd Python-3.9.4 && \
    ./configure --enable-optimizations && \
    make altinstall && cd .. && rm Python-3.9.4.tgz
    
# Install pika, redis, psycopg2, paramiko and scp Python packages
RUN pip3.9 install --no-cache-dir pika redis psycopg2-binary paramiko scp
