FROM centos:7

LABEL maintainer="OnApp"

RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash -

RUN yum -y update && \
    yum -y groupinstall 'Development Tools' && \
    yum -y install \
        make \
        wget \
        openssh-clients \
        git \
        mysql-devel \
        libvirt-devel \
        nodejs

# installing specific version of ruby centos7 repo might contain unsuitable ruby version
RUN wget -O ruby-install.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.1.tar.gz && \
    mkdir ruby-install && \
    tar -xzvf ruby-install.tar.gz -C ruby-install --strip 1 && \
    rm -f ruby-install.tar.gz && \
    cd ruby-install && \
    make install && \
    ruby-install --system ruby 2.6.6 && \
    cd .. && \
    rm -fr ruby-install && \
    gem install bundler:2.1.4

ENV BUNDLE_PATH /gems

WORKDIR /usr/src/app
