FROM centos:6 MAINTAINER cfgonzalezr@concredito.com.mx ENV SRC_WORKDIR /home WORKDIR $SRC_WORKDIR ###################################### # Updating and installing packages ## ###################################### ADD mod_evasive_1.10.1.tar.gz . RUN yum update -y && yum install -y \ yum-utils wget tar git \ epel* \ && wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm \ && rpm -Uvh remi-release-6*.rpm \ && yum-config-manager --enable remi-php56 \ && yum update -y && yum upgrade -y \ && yum install -y \ autoconf \ automake \ curl \ curl-devel \ gcc-c++.x86_64 \ httpd \ httpd-devel \ libtool \ libxml2 \ libxml2-devel \ make \ mod_ssl \ openssl-devel \ pcre \ pcre-devel \ pdo-mysql \ php php-devel php-pdo php-mcrypt php-mbstring php-xml \ php-mysqlnd \ php-imagick \ php-gd \ php-soap \ php-bcmath \ # && wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz \ # && tar -xvzf mod_evasive_1.10.1.tar.gz && rm mod_evasive_1.10.1.tar.gz -f \ && cd mod_evasive \ && apxs -cia mod_evasive20.c \ && cd /home && rm -rf mod_evasive \ # ###################### ## getting composer ## ###################### # && curl -sS https://getcomposer.org/installer | php \ && mv composer.phar /usr/local/bin/composer \ # ###################### ## Installing cmake ## ###################### # && wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz --no-check-certificate \ && tar -xzvf cmake-3.3.2.tar.gz \ && rm cmake-3.3.2.tar.gz \ && cd /home/cmake-3.3.2 \ && ./configure \ && make \ && make install \ && ln -s /usr/local/bin/cmake /usr/bin/ \ && cd /home \ && rm -rf cmake-3.3.2 \ # ##################### ## Installing YAJL ## ##################### # && cd /home \ && git clone https://github.com/lloyd/yajl && cd yajl \ && ./configure \ && make \ && make install \ # ######################i##### ## Installing modsecurity ## ############################ # && cd /home \ && git clone https://github.com/SpiderLabs/ModSecurity \ && cd ModSecurity \ && git checkout v2.9.3 \ && ./autogen.sh \ && ./configure --with-yajl="/usr/local/lib /usr/local/include" \ && make && make install \ && chmod 755 /etc/httpd/modules/mod_security2.so \ && cp /usr/local/lib/libyajl* /lib64/ \ # ######################## ## Installing mongodb ## ######################## # && cd /home \ && git clone https://github.com/mongodb/mongo-php-driver-legacy.git \ && cd mongo-php-driver-legacy \ && phpize \ && ./configure \ && make \ && make install \ && touch /etc/php.d/mongo.ini \ && echo "; Enable mongo extension" >> /etc/php.d/mongo.ini \ && echo "extension=mongo.so" >> /etc/php.d/mongo.ini \ # ###################################### ## Configuracion ZonaHoraria ## ###################################### && cp /etc/localtime /etc/old.timezone.bak && rm /etc/localtime \ && ln -s /usr/share/zoneinfo/America/Mazatlan /etc/localtime \ # # ######################i##### ## Cleaning the container ## ############################ # && rm -rf /home/* \ && yum clean all \ && rm -rf /tmp/* /var/tmp/* COPY /api-server-config/httpd /etc/httpd COPY /api-server-config/php/php.ini /etc/ ADD .ssh /root/.ssh RUN cd /etc/httpd/modsecurity-crs/custom_rules \ && wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz \ && tar -xvzf GeoLite2-City.tar.gz \ && cd /etc/httpd/modsecurity-crs \ && for f in `ls base_rules/`; do ln -s ../base_rules/$f activated_rules/$f; done \ && for f in `ls custom_rules/`; do ln -s ../custom_rules/$f activated_rules/$f; done \ && cd /etc/httpd/conf.d \ && ln -s ../modsecurity-crs/config/modsecurity.conf ./ \ && mkdir /etc/httpd/sites-enabled \ && ln -s /etc/httpd/sites-available/api.concredito.com.mx \ /etc/httpd/sites-enabled/api.concredito.com.mx.conf \ && ln -s /etc/httpd/sites-available/star.concredito.io \ /etc/httpd/sites-enabled/star.concredito.io.conf