#
# This file is part of vospace-transfer-service
# Copyright (C) 2021 Istituto Nazionale di Astrofisica
# SPDX-License-Identifier: GPL-3.0-or-later
#

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