# 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 and rsync
RUN yum -y install make nano openssh-clients wget rsync

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