8 Star 26 Fork 5

xin.chu / nginx-php7-composer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Dockerfile 3.83 KB
一键复制 编辑 原始数据 按行查看 历史
APPLE 提交于 2018-04-17 17:05 . Init project
FROM centos:7
MAINTAINER cccchu <cccchu@163.com>
ENV NGINX_VERSION 1.13.9
ENV PHP_VERSION 7.2.3
RUN set -x && \
yum install -y gcc \
gcc-c++ \
autoconf \
automake \
libtool \
make \
cmake && \
#Install PHP library
## libmcrypt-devel DIY
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm && \
yum install -y zlib \
zlib-devel \
openssl \
openssl-devel \
pcre-devel \
libxml2 \
libxml2-devel \
libcurl \
libcurl-devel \
libpng-devel \
libjpeg-devel \
freetype-devel \
libmcrypt-devel \
openssh-server \
python-setuptools && \
#Add user
mkdir -p /data/{www,phpextini,phpextfile} && \
useradd -r -s /sbin/nologin -d /data/www -m -k no www && \
#Download nginx & php
mkdir -p /home/nginx-php && cd $_ && \
curl -Lk http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | gunzip | tar x -C /home/nginx-php && \
curl -Lk http://php.net/distributions/php-$PHP_VERSION.tar.gz | gunzip | tar x -C /home/nginx-php && \
#Make install nginx
cd /home/nginx-php/nginx-$NGINX_VERSION && \
./configure --prefix=/usr/local/nginx \
--user=www --group=www \
--error-log-path=/var/log/nginx_error.log \
--http-log-path=/var/log/nginx_access.log \
--pid-path=/var/run/nginx.pid \
--with-pcre \
--with-http_ssl_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--with-http_gzip_static_module && \
make && make install && \
#Make install php
cd /home/nginx-php/php-$PHP_VERSION && \
./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/data/phpextini \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mcrypt=/usr/include \
--with-mysqli \
--with-pdo-mysql \
--with-openssl \
--with-gd \
--with-iconv \
--with-zlib \
--with-gettext \
--with-curl \
--with-png-dir \
--with-jpeg-dir \
--with-freetype-dir \
--with-xmlrpc \
--with-mhash \
--enable-fpm \
--enable-xml \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--enable-mysqlnd \
--enable-pcntl \
--enable-sockets \
--enable-zip \
--enable-soap \
--enable-session \
--enable-opcache \
--enable-bcmath \
--enable-exif \
--enable-fileinfo \
--disable-rpath \
--enable-ipv6 \
--disable-debug \
--without-pear && \
make && make install && \
#Install php-fpm
cd /home/nginx-php/php-$PHP_VERSION && \
cp php.ini-production /usr/local/php/etc/php.ini && \
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf && \
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf && \
#Install supervisor
easy_install supervisor && \
mkdir -p /var/{log/supervisor,run/{sshd,supervisord}} && \
#Clean OS
rm -rf /tmp/* /var/cache/{yum,ldconfig} /etc/my.cnf{,.d} && \
mkdir -p --mode=0755 /var/cache/{yum,ldconfig} && \
find /var/log -type f -delete && \
rm -rf /home/nginx-php && \
#Change Mod from webdir
chown -R www:www /data/www
#Add supervisord conf
ADD supervisord.conf /etc/
#Create web folder
# WEB Folder: /data/www
# SSL Folder: /usr/local/nginx/conf/ssl
# Vhost Folder: /usr/local/nginx/conf/vhost
# php extfile ini Folder: /usr/local/php/etc/conf.d
# php extfile Folder: /data/phpextfile
VOLUME ["/data/www", "/usr/local/nginx/conf/ssl", "/usr/local/nginx/conf/vhost", "/data/phpextini", "/data/phpextfile"]
ADD index.php /data/www/
#Update nginx config
ADD nginx.conf /usr/local/nginx/conf/
#Start
ADD start.sh /
RUN chmod +x /start.sh
#Set port
EXPOSE 80 443
#Start it
ENTRYPOINT ["/start.sh"]
#Start web server
#CMD ["/bin/bash", "/start.sh"]
PHP
1
https://gitee.com/ccccccchu/nginx-php7-composer.git
git@gitee.com:ccccccchu/nginx-php7-composer.git
ccccccchu
nginx-php7-composer
nginx-php7-composer
master

搜索帮助