# Nginx Server
# Version 1.18.0
FROM centos:7
MAINTAINER .com
RUN yum -y install gcc gcc-c++ autoconf automake make wget pcre pcre-devel zlib-devel && \
yum clean all && \
rm -rf /var/cache/yum/*
RUN wget http://nginx.org/download/nginx-1.18.0.tar.gz && \
tar zxvf nginx-1.18.0.tar.gz && \
cd nginx-1.18.0 && \
./configure --prefix=/usr/local/nginx && \
make && make install && \
cd ../ && \
rm -rf nginx-1.18.0.tar.gz && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ENV PATH $PATH:/usr/local/nginx/sbin
WORKDIR /usr/local/nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# PHP-FPM
# Version 7.2.33
FROM centos:7
MAINTAINER .com
RUN yum -y install gcc gcc-c++ autoconf automake make wget libxml2-devel libpng libpng-devel && \
yum clean all && \
rm -rf /var/cache/yum/*
RUN wget https://www.php.net/distributions/php-7.2.33.tar.gz && \
tar zxvf php-7.2.33.tar.gz && \
cd php-7.2.33 && \
./configure --prefix=/usr/local/php --enable-mysqlnd --with-mysqli=mysqlnd --enable-fpm --enable-gd-jis-conv --with-gd && \
make && make install && \
cd ../ && \
rm -rf php-7.2.33.tar.gz && \
rm -rf php-7.2.33 && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
cd /usr/local/php && \
cp ./etc/php-fpm.conf.default ./etc/php-fpm.conf && \
cp ./etc/php-fpm.d/www.conf.default ./etc/php-fpm.d/www.conf
WORKDIR /usr/local/php
EXPOSE 9000
CMD ["./sbin/php-fpm", "-F"]