[root@docker-lnmp nginx]# vim dockerfile
from docker.io/centos:7
run yum -y update
run yum -y install gcc gcc-c++ openssl-devel openssl autoconf cmake autoconf zlib zlib-devel libtool pcre pcre-devel wget net-tools make
run groupadd -g 900 nginx && useradd nginx -g nginx -s /sbin/nologin
from docker.io/centos:7
run yum -y update
run yum -y install gcc gcc-c++ openssl-devel openssl autoconf cmake autoconf zlib zlib-devel libtool pcre pcre-devel wget net-tools make
run groupadd -g 900 nginx && useradd nginx -g nginx -s /sbin/nologin
add nginx-1.12.2 nginx-1.12.2
run cd /nginx-1.12.2/ && ./configure –prefix=/usr/local/nginx –with-http_dav_module –with-http_stub_status_module –with-http_addition_module –with-http_sub_module –with-http_flv_module –with-http_mp4_module –with-http_ssl_module –with-http_gzip_static_module –user=nginx –group=nginx
run cd /nginx-1.12.2/ && make && make install
run ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/
run sed -i 1afastcgi_param script_filename $document_root$fastcgi_script_name; /usr/local/nginx/conf/fastcgi_params
add nginx.conf /usr/local/nginx/conf/
add wordpress /usr/local/nginx/html/wordpress
add wp-config.php /usr/local/nginx/html/wordpress
run yum -y install gcc gcc-c++ libxml2-devel libcurl-devel openssl-devel bzip2-devel openssl automake make autoconf libtool zlib-devel make pcre-devel wget net-tools
add libmcrypt-2.5.7 libmcrypt-2.5.7
run cd libmcrypt-2.5.7/&& ./configure –prefix=/usr/local/libmcrypt && make && make install
add php-5.5.38 php-5.5.38
run cd php-5.5.38/ && ./configure –prefix=/usr/local/php5.5 –with-mysql=mysqlnd –with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –with-openssl –enable-fpm –enable-sockets –enable-sysvshm –enable-mbstring –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –with-mhash –with-mcrypt=/usr/local/libmcrypt –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –with-bz2 –enable-maintainer-zts && make && make install
run cd php-5.5.38 && cp php.ini-production /etc/php.ini
run cd /php-5.5.38 && cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
run chmod +x /etc/init.d/php-fpm && chkconfig –add php-fpm && chkconfig php-fpm on
run cp /usr/local/php5.5/etc/php-fpm.conf.default /usr/local/php5.5/etc/php-fpm.conf
run sed -i s*;pid = run/php-fpm.pid*pid = run/php-fpm.pid*g /usr/local/php5.5/etc/php-fpm.conf
run sed -i s/user = nobody/user = nginx/g /usr/local/php5.5/etc/php-fpm.conf
run sed -i s/group = nobody/group = nginx/g /usr/local/php5.5/etc/php-fpm.conf
run sed -i s/pm.max_children = 5/pm.max_children = 50/g /usr/local/php5.5/etc/php-fpm.conf
run sed -i s/pm.start_servers = 2/pm.start_servers = 5/g /usr/local/php5.5/etc/php-fpm.conf
run sed -i s/pm.min_spare_servers = 1/pm.min_spare_servers = 5/g /usr/local/php5.5/etc/php-fpm.conf
run sed -i s/pm.max_spare_servers = 3/pm.max_spare_servers = 30/g /usr/local/php5.5/etc/php-fpm.conf
expose 9000
expose 80