提交 d15dd792 authored 作者: 陈欢's avatar 陈欢

fix

上级 d0cd6a3d
## [0.6.4] - 05-09-2020
- nginx version 1.19.2 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.4.9 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.10.10 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.6.3] - 18-07-2020
- nginx version 1.19.1 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.4.8 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.10.9 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.6.2] - 11-03-2020
- nginx version 1.17.9 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.4.3 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.9.3 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.6.1] - 29-12-2019
- nginx version 1.17.7 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.4.1 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.6.0] - 05-11-2019
- nginx version 1.17.5 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.3.11 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.9.1 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.5.9] - 09-08-2019
- debian to version buster - [https://hub.docker.com/_/debian/](https://hub.docker.com/_/debian/)
- nginx version 1.17.2 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.3.8 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.9.0 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.5.8] - 09-05-2019
- nginx version 1.15.12 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.3.5 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.5.7] - 16-04-2019
- nginx version 1.15.11 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.3.4 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.8.5 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.5.6]- 12-03-2019
- php version 7.3.3 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- nginx version 1.15.9 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.5.5]- 12-02-2019
- php version 7.3.2 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.8.4 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.5.4] - 24-01-2019
- nginx version 1.15.8 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.3.1 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.8.0 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.5.3] - 08-12-2018
- php version 7.3.0 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.5.2] - 27-11-2018
### Update
- fix for [cannot open '/dev/tty': No such device or address](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913614)
## [0.5.1] - 27-11-2018
- nginx version 1.15.7 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- add keyserver
## [0.5.0] - 27-11-2018
- nginx version 1.15.6 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.12 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.7.3 [https://getcomposer.org/download/](https://getcomposer.org/download/)
- add bcmath extension
- logo update
## [0.4.9] - 03-11-2018
- nginx to version 1.15.5 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.11 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.4.8] - 01-10-2018
- nginx to version 1.15.4 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.10 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.4.7] - 01-09-2018
- nginx to version 1.15.3 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.9 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.7.2 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.4.6] - 08-08-2018
- composer version 1.7.1 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.4.5] - 26-07-2018
### Update
- nginx to version 1.15.2 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.8 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.4.4] - 10-07-2018
### Update
- Created PHP 7.2.x branch; Readme update
## [0.4.3] - 04-07-2018
### Update
- nginx to version 1.15.1 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.4.2] - 01-07-2018
### Update
- add additional keyservers for retrieving nginx signing GPG key
## [0.4.1] - 26-06-2018
### Update
- php version 7.2.7 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.4.0] - 12-06-2018
### Update
- nginx to version 1.15.0 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.6 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.3.9] - 07-05-2018
- composer version 1.6.5 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.3.8] - 06-05-2018
- [php version 7.2.5 available](https://github.com/oerdnj/deb.sury.org/issues/858#issuecomment-386828748)
## [0.3.7] - 01-05-2018
- README update: PHP version correction; PHP v7.2.5 not currently available in the deb.sury.org package
## [0.3.6] - 26-04-2018
### Update
- nginx to version 1.13.12 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.5 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- composer version 1.6.4 [https://getcomposer.org/download/](https://getcomposer.org/download/)
## [0.3.5] - 08-04-2018
### Update
- nginx to version 1.13.11 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2.4 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.3.4] - 25-03-2018
### Update
- nginx to version 1.13.10 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- composer version 1.6.3 added [https://getcomposer.org/download/](https://getcomposer.org/download/)
- php version 7.2.3 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.3.3] - 24-01-2018
### Update
- nginx to version 1.13.8 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.3.2] - 23-12-2017
### Update
- nginx to version 1.13.7 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.2 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.3.1] - 03-11-2017
### Update
- php version 7.1.11 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.3.0] - 17-10-2017
### Update
- nginx to version 1.13.6 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.1.10 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.2.9] - 05-09-2017
### Update
- nginx to version 1.13.5 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 7.1.9 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.2.8] - 09-08-2017
### Update
- nginx to version 1.13.4 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.2.7] - 04-08-2017
### Update
- php version 7.1.8 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.2.6] - 13-07-2017
### Update
- nginx to version 1.13.3 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES) Security: CVE-2017-7529
## [0.2.5] - 10-07-2017
### Update
- php version 7.1.7 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.2.4] - 27-06-2017
### Update
- nginx to version 1.13.2 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.2.3] - 23-06-2017
### Update
- upgrade base image to debian stretch
## [0.2.2] - 08-06-2017
### Update
- php version 7.1.6 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.2.1] - 31-05-2017
### Update
- nginx to version 1.13.1 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.2.0] - 12-05-2017
### Update
- php version 7.1.5 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
## [0.1.9] - 26-04-2017
### Update
- nginx to version 1.13.0 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.8] - 13-04-2017
### Update
- php version 7.1.4 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- nginx to version 1.11.13 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.7] - 21-03-2017
### Update
- README.md update
- nginx to version 1.11.11 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.6] - 15-03-2017
### Update
- php package switched to [https://deb.sury.org/](https://deb.sury.org/)
- Dockerfile updates
- License update
- php version 7.1.3 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- nginx to version 1.11.10 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.5] - 15-03-2017
### Update
- php version 7.0.16 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- nginx to version 1.11.10 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.4] - 14-12-2016
### Update
- php version 7.0.14 available - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- nginx to version 1.11.7 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.3] - 20-11-2016
### Update
- php to version 7.0.13 - [https://secure.php.net/ChangeLog-7.php](https://secure.php.net/ChangeLog-7.php)
- nginx to version 1.11.6 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
## [0.1.2] - 18-11-2016
### Update
- php to version 7.0.12
- nginx to version 1.11.5
## [0.1.1] - 21-09-2016
### Update
- php to version 7.0.11
## [0.1.0] - 17-09-2016
### Update
- nginx to version 1.11.4
## [0.0.0] - 28-08-2016
### Added
- .dockerignore file
FROM debian:buster
LABEL maintainer="Colin Wilson colin@wyveo.com"
# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive
ENV NGINX_VERSION 1.19.2-1~buster
ENV php_conf /etc/php/7.4/fpm/php.ini
ENV fpm_conf /etc/php/7.4/fpm/pool.d/www.conf
ENV COMPOSER_VERSION 1.10.10
RUN echo "deb http://mirrors.aliyun.com/debian buster main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian buster main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list
# Install Basic Requirements
RUN buildDeps='curl gcc make autoconf libc-dev zlib1g-dev pkg-config' \
&& set -x \
&& apt-get update \
&& apt-get install --no-install-recommends $buildDeps --no-install-suggests -q -y gnupg2 dirmngr wget apt-transport-https lsb-release ca-certificates \
&& \
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \
found=''; \
for server in \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo "Fetching GPG key $NGINX_GPGKEY from $server"; \
apt-key adv --batch --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \
echo "deb http://nginx.org/packages/mainline/debian/ buster nginx" >> /etc/apt/sources.list \
&& wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \
&& echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -q -y \
apt-utils \
nano \
zip \
unzip \
python-pip \
python-setuptools \
git \
libmemcached-dev \
libmemcached11 \
libmagickwand-dev \
nginx=${NGINX_VERSION} \
php7.4-fpm \
php7.4-cli \
php7.4-bcmath \
php7.4-dev \
php7.4-common \
php7.4-json \
php7.4-opcache \
php7.4-readline \
php7.4-mbstring \
php7.4-curl \
php7.4-gd \
php7.4-imagick \
php7.4-mysql \
php7.4-zip \
php7.4-pgsql \
php7.4-intl \
php7.4-xml \
php-pear \
&& pecl -d php_suffix=7.4 install -o -f redis memcached mongodb \
&& mkdir -p /run/php \
&& pip install wheel \
&& pip install supervisor supervisor-stdout \
&& echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d \
&& rm -rf /etc/nginx/conf.d/default.conf \
&& sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" ${php_conf} \
&& sed -i -e "s/memory_limit\s*=\s*.*/memory_limit = 256M/g" ${php_conf} \
&& sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" ${php_conf} \
&& sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" ${php_conf} \
&& sed -i -e "s/variables_order = \"GPCS\"/variables_order = \"EGPCS\"/g" ${php_conf} \
&& sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php/7.4/fpm/php-fpm.conf \
&& sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" ${fpm_conf} \
&& sed -i -e "s/pm.max_children = 5/pm.max_children = 4/g" ${fpm_conf} \
&& sed -i -e "s/pm.start_servers = 2/pm.start_servers = 3/g" ${fpm_conf} \
&& sed -i -e "s/pm.min_spare_servers = 1/pm.min_spare_servers = 2/g" ${fpm_conf} \
&& sed -i -e "s/pm.max_spare_servers = 3/pm.max_spare_servers = 4/g" ${fpm_conf} \
&& sed -i -e "s/pm.max_requests = 500/pm.max_requests = 200/g" ${fpm_conf} \
&& sed -i -e "s/www-data/nginx/g" ${fpm_conf} \
&& sed -i -e "s/^;clear_env = no$/clear_env = no/" ${fpm_conf} \
&& echo "extension=redis.so" > /etc/php/7.4/mods-available/redis.ini \
&& echo "extension=memcached.so" > /etc/php/7.4/mods-available/memcached.ini \
&& ln -sf /etc/php/7.4/mods-available/redis.ini /etc/php/7.4/fpm/conf.d/20-redis.ini \
&& ln -sf /etc/php/7.4/mods-available/redis.ini /etc/php/7.4/cli/conf.d/20-redis.ini \
&& ln -sf /etc/php/7.4/mods-available/memcached.ini /etc/php/7.4/fpm/conf.d/20-memcached.ini \
&& ln -sf /etc/php/7.4/mods-available/memcached.ini /etc/php/7.4/cli/conf.d/20-memcached.ini \
# Install Composer
&& curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --version=${COMPOSER_VERSION} \
&& rm -rf /tmp/composer-setup.php \
# Clean up
&& rm -rf /tmp/pear \
&& apt-get purge -y --auto-remove $buildDeps \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
# Supervisor config
ADD ./supervisord.conf /etc/supervisord.conf
# Override nginx's default config
ADD ./default.conf /etc/nginx/conf.d/default.conf
# Override default nginx welcome page
COPY html /usr/share/nginx/html
# ADD-CRONTABS
COPY ./crontabs/default /var/spool/cron/crontabs/
RUN cat /var/spool/cron/crontabs/default >> /var/spool/cron/crontabs/root
RUN mkdir -p /var/log/cron \
&& touch /var/log/cron/cron.log
VOLUME /var/log/cron
# Add Scripts
ADD ./start.sh /start.sh
EXPOSE 80
CMD ["/start.sh"]
Copyright (c) 2020 wyveo.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[![Docker Hub; wyveo/nginx-php-fpm](https://img.shields.io/badge/docker%20hub-wyveo%2Fnginx--php--fpm-blue.svg?&logo=docker&style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![](https://badges.weareopensource.me/docker/pulls/wyveo/nginx-php-fpm?style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![](https://badges.weareopensource.me/docker/image-size/wyveo/nginx-php-fpm/php74?style=for-the-badge)](https://microbadger.com/images/wyveo/nginx-php-fpm) [![](https://img.shields.io/microbadger/layers/wyveo/nginx-php-fpm/latest.svg?&style=for-the-badge)](https://microbadger.com/images/wyveo/nginx-php-fpm) [![nginx 1.19.2](https://img.shields.io/badge/nginx-1.19.2-brightgreen.svg?&logo=nginx&logoColor=white&style=for-the-badge)](https://nginx.org/en/CHANGES) [![php 7.4.9](https://img.shields.io/badge/php--fpm-7.4.9-blue.svg?&logo=php&logoColor=white&style=for-the-badge)](https://secure.php.net/releases/7_4_9.php) [![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?&style=for-the-badge)](https://github.com/wyveo/nginx-php-fpm/blob/master/LICENSE)
## Introduction
This is a Dockerfile to build a debian based container image running nginx and php-fpm 7.4.x / 7.3.x / 7.2.x / 7.1.x / 7.0.x & Composer.
### Versioning
| Docker Tag | GitHub Release | Nginx Version | PHP Version | Debian Version |
|-----|-------|-----|--------|--------|
| latest | master Branch |1.19.2 | 7.4.9 | buster |
| php74 | php74 Branch |1.19.2 | 7.4.9 | buster |
| php73 | php73 Branch |1.19.2 | 7.3.21 | buster |
| php72 | php72 Branch |1.19.2 | 7.2.33 | buster |
| php71 | php71 Branch |1.19.2 | 7.1.33 | buster |
| php70 | php70 Branch |1.19.2 | 7.0.33 | buster |
## Building from source
To build from source you need to clone the git repo and run docker build:
```
$ git clone https://github.com/wyveo/nginx-php-fpm.git
$ cd nginx-php-fpm
```
followed by
```
$ docker build -t nginx-php-fpm:latest . # PHP 7.4.x
```
or
```
$ docker build -t nginx-php-fpm:php74 . # PHP 7.4.x
```
## Pulling from Docker Hub
```
$ docker pull wyveo/nginx-php-fpm:latest
```
## Running
To run the container:
```
$ sudo docker run -d wyveo/nginx-php-fpm:latest
```
Default web root:
```
/usr/share/nginx/html
```
# do daily/weekly/monthly maintenance
# min hour day month weekday command
# * * * * * /usr/bin/php /usr/share/nginx/html/artisan schedule:run >> /dev/null 2>&1
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/html/public;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
sendfile off;
# Security - Hide nginx version number in error pages and Server header
server_tokens off;
# Add stdout logging
error_log /dev/stdout info;
access_log /dev/stdout;
# reduce the data that needs to be sent over network
gzip on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml application/json text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.php
try_files $uri $uri/ /index.php?$query_string;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on socket
#
location ~ \.php$ {
try_files $uri $uri/ /index.php?$query_string;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 5d;
}
# deny access to . files, for security
#
location ~ /\. {
log_not_found off;
deny all;
}
}
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */img,legend{border:0}legend,td,th{padding:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}
.column,.columns,.container,.u-full-width{width:100%;box-sizing:border-box}h1,h2,h3{letter-spacing:-.1rem}body,h6{line-height:1.6}.container{position:relative;max-width:960px;margin:0 auto;padding:0 20px}ol,p,ul{margin-top:0}.column,.columns{float:left}@media (min-width:400px){.container{width:85%;padding:0}}html{font-size:62.5%}body{font-size:1.5em;font-weight:400;font-family:Montserrat,HelveticaNeue,"Helvetica Neue",Helvetica,Arial,sans-serif;color:#222}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:2rem;font-weight:300}h1{font-size:4rem;line-height:1.2}h2{font-size:3.6rem;line-height:1.25}h3{font-size:3rem;line-height:1.3}h4{font-size:2.4rem;line-height:1.35;letter-spacing:-.08rem}h5{font-size:1.8rem;line-height:1.5;letter-spacing:-.05rem}h6{font-size:1.5rem;letter-spacing:0}@media (min-width:550px){.container{width:80%}.column,.columns{margin-left:4%}.column:first-child,.columns:first-child{margin-left:0}.one.column,.one.columns{width:4.66666666667%}.two.columns{width:13.3333333333%}.three.columns{width:22%}.four.columns{width:30.6666666667%}.five.columns{width:39.3333333333%}.six.columns{width:48%}.seven.columns{width:56.6666666667%}.eight.columns{width:65.3333333333%}.nine.columns{width:74%}.ten.columns{width:82.6666666667%}.eleven.columns{width:91.3333333333%}.twelve.columns{width:100%;margin-left:0}.one-third.column{width:30.6666666667%}.two-thirds.column{width:65.3333333333%}.one-half.column{width:48%}.offset-by-one.column,.offset-by-one.columns{margin-left:8.66666666667%}.offset-by-two.column,.offset-by-two.columns{margin-left:17.3333333333%}.offset-by-three.column,.offset-by-three.columns{margin-left:26%}.offset-by-four.column,.offset-by-four.columns{margin-left:34.6666666667%}.offset-by-five.column,.offset-by-five.columns{margin-left:43.3333333333%}.offset-by-six.column,.offset-by-six.columns{margin-left:52%}.offset-by-seven.column,.offset-by-seven.columns{margin-left:60.6666666667%}.offset-by-eight.column,.offset-by-eight.columns{margin-left:69.3333333333%}.offset-by-nine.column,.offset-by-nine.columns{margin-left:78%}.offset-by-ten.column,.offset-by-ten.columns{margin-left:86.6666666667%}.offset-by-eleven.column,.offset-by-eleven.columns{margin-left:95.3333333333%}.offset-by-one-third.column,.offset-by-one-third.columns{margin-left:34.6666666667%}.offset-by-two-thirds.column,.offset-by-two-thirds.columns{margin-left:69.3333333333%}.offset-by-one-half.column,.offset-by-one-half.columns{margin-left:52%}h1{font-size:5rem}h2{font-size:4.2rem}h3{font-size:3.6rem}h4{font-size:3rem}h5{font-size:2.4rem}h6{font-size:1.5rem}}a{color:#1EAEDB}a:hover{color:#0FA0CE}.button,button,input[type=submit],input[type=reset],input[type=button]{display:inline-block;height:38px;padding:0 30px;color:#555;text-align:center;font-size:11px;font-weight:600;line-height:38px;letter-spacing:.1rem;text-transform:uppercase;text-decoration:none;white-space:nowrap;background-color:transparent;border-radius:4px;border:1px solid #bbb;cursor:pointer;box-sizing:border-box}.button:focus,.button:hover,button:focus,button:hover,input[type=submit]:focus,input[type=submit]:hover,input[type=reset]:focus,input[type=reset]:hover,input[type=button]:focus,input[type=button]:hover{color:#333;border-color:#888;outline:0}.button.button-primary,button.button-primary,input[type=submit].button-primary,input[type=reset].button-primary,input[type=button].button-primary{color:#FFF;background-color:#33C3F0;border-color:#33C3F0}.button.button-primary:focus,.button.button-primary:hover,button.button-primary:focus,button.button-primary:hover,input[type=submit].button-primary:focus,input[type=submit].button-primary:hover,input[type=reset].button-primary:focus,input[type=reset].button-primary:hover,input[type=button].button-primary:focus,input[type=button].button-primary:hover{color:#FFF;background-color:#1EAEDB;border-color:#1EAEDB}input[type=tel],input[type=url],input[type=password],input[type=email],input[type=number],input[type=search],input[type=text],select,textarea{height:38px;padding:6px 10px;background-color:#fff;border:1px solid #D1D1D1;border-radius:4px;box-shadow:none;box-sizing:border-box}input[type=tel],input[type=url],input[type=password],input[type=email],input[type=number],input[type=search],input[type=text],textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none}textarea{min-height:65px;padding-top:6px;padding-bottom:6px}input[type=tel]:focus,input[type=url]:focus,input[type=password]:focus,input[type=email]:focus,input[type=number]:focus,input[type=search]:focus,input[type=text]:focus,select:focus,textarea:focus{border:1px solid #33C3F0;outline:0}label,legend{display:block;margin-bottom:.5rem;font-weight:600}fieldset{padding:0;border-width:0}input[type=checkbox],input[type=radio]{display:inline}label>.label-body{display:inline-block;margin-left:.5rem;font-weight:400}ul{list-style:circle inside}ol{list-style:decimal inside}ol,ul{padding-left:0}ol ol,ol ul,ul ol,ul ul{margin:1.5rem 0 1.5rem 3rem;font-size:90%}.button,button,li{margin-bottom:1rem}code{padding:.2rem .5rem;margin:0 .2rem;font-size:90%;white-space:nowrap;background:#F1F1F1;border:1px solid #E1E1E1;border-radius:4px}pre>code{display:block;padding:1rem 1.5rem;white-space:pre}td,th{padding:12px 15px;text-align:left;border-bottom:1px solid #E1E1E1}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}.u-max-full-width{max-width:100%;box-sizing:border-box}.u-pull-right{float:right}.u-pull-left{float:left}hr{margin-top:3rem;margin-bottom:3.5rem;border-width:0;border-top:1px solid #E1E1E1}.container:after,.row:after,.u-cf{content:"";display:table;clear:both}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<title>Docker | wyveo/nginx-php-fpm</title>
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- FONT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/skeleton.min.css">
<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/png" href="images/favicon.png">
</head>
<body>
<!-- Primary Page Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<div class="container">
<div class="row">
<div class="one-half column" style="margin-top: 25%">
<img height="45px" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDYyOS4yMiA2OTkuNSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTM0OS4yNSAxOS43NWMtMTkuMDUtMTEtNTAuMjMtMTEtNjkuMjggMGwtMjMzLjgzIDEzNWMtMTkgMTEtMzQuNjQgMzgtMzQuNjQgNjB2MjcwYzAgMjIgMTUuNTkgNDkgMzQuNjQgNjBsMjMzLjg2IDEzNWMxOSAxMSA1MC4yMyAxMSA2OS4yOCAwbDIzMy44My0xMzVjMTktMTEgMzQuNjQtMzggMzQuNjQtNjB2LTI3MGMwLTIyLTE1LjU5LTQ5LTM0LjY0LTYweiIvPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFmMWYxZiIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIzIiBkPSJNMzQ5LjI1IDE5Ljc1Yy0xOS4wNS0xMS01MC4yMy0xMS02OS4yOCAwbC0yMzMuODMgMTM1Yy0xOSAxMS0zNC42NCAzOC0zNC42NCA2MHYyNzBjMCAyMiAxNS41OSA0OSAzNC42NCA2MGwyMzMuODYgMTM1YzE5IDExIDUwLjIzIDExIDY5LjI4IDBsMjMzLjgzLTEzNWMxOS0xMSAzNC42NC0zOCAzNC42NC02MHYtMjcwYzAtMjItMTUuNTktNDktMzQuNjQtNjB6Ii8+PHBhdGggZD0iTTE1Ni40MSAyNzIuNzJjLTIuOTQtMTYuMzItNy41MS0zNCAxNi0zNGgyMi41M2MyMi44NCAwIDI1Ljc4IDE3LjYzIDI2Ljc2IDI1Ljc5bDI0LjE1IDE0NC42aDJjMy45Mi0zNS4yNiAxOS4yNi0xMzMuNSAyMS4yMi0xNDQgMi4yOC0xNS42NyAzLjkyLTI2LjQ0IDI0LjgxLTI2LjQ0SDMzNWMyMC41NyAwIDIzLjUgMTggMjQuNDggMjYuNDQgMy4yNyAyNS40NiAxOCAxMjAuMTIgMjIuNTIgMTQ0LjI3aDJjMy41OS0zNC42IDE4LjI4LTEzNC40OCAxOS45MS0xNDQuNiAyLjYxLTE2IDMuOTItMjYuMTEgMjQuODEtMjYuMTFoMzJjMTYuMzIgMCAxNiAxNy42MyAxMy4wNSAzMi04LjE2IDM5LjE3LTMxLjY2IDEzOC43Mi0zNC45MiAxNTIuNDMtMy4yNiAxNi01Ljg4IDM3LjU0LTMzLjYyIDM3LjU0aC00MC41OGMtMTQuMzYgMC0yNi40My01Ljg4LTI4LjA2LTI0LjE2LTItMTctMTcuMzEtMTE1Ljg3LTIxLjg3LTE0MWgtMmMtNC4yNSAzNS45LTE3Ljk1IDEyMC4xMS0yMC44OSAxNDEuNjYtMi4yOSAxOC4yNy0xMy4wNiAyMy41LTI4LjA3IDIzLjVoLTQyLjA3Yy0yNC40OCAwLTI4LjcyLTE5LjU5LTMyLjMxLTMzLTMuOTItMTYuODUtMjguMzgtMTMxLjA5LTMyLjk3LTE1NC45MnoiLz48L3N2Zz4=">
<h4>Congratulations!</h4>
<p>You have successfully deployed a <strong>docker</strong> container running our <strong>NGINX</strong> with <strong>PHP-FPM 7.x</strong> image</p>
<p><strong>NGINX: </strong>v<?php echo $_ENV['NGINX_VERSION'] ?><br><strong>PHP-FPM: </strong>v<?php echo phpversion(); ?><br><strong>HOSTNAME: </strong><?php echo gethostname(); ?><br><strong>WEB ROOT: </strong><?php echo $_ENV['DOCUMENT_ROOT'] ?></p>
<em>Thank you for using <a style="text-decoration:none" href="https://wyveo.com" target="_blank">wyveo.com</a></em>
</div>
</div>
</div>
<!-- End Document
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
</body>
</html>
#!/bin/bash
# Update nginx to match worker_processes to no. of cpu's
procs=$(cat /proc/cpuinfo | grep processor | wc -l)
sed -i -e "s/worker_processes 1/worker_processes $procs/" /etc/nginx/nginx.conf
# Always chown webroot for better mounting
chown -Rf nginx.nginx /usr/share/nginx/html
myEnv="/srv/.env"
if [ -f "$myEnv" ]; then
cp /srv/.env /src/www/.env
fi
#cp /srv/.env /srv/www/.env
# Start supervisord and services
/usr/local/bin/supervisord -n -c /etc/supervisord.conf
/usr/sbin/crond -f -L /var/log/cron/cron.log
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
username=nobody
password=nobody
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
user=root ; (default is current user, required if root)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:php-fpm7]
command=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config=/etc/php/7.4/fpm/pool.d/www.conf
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
autostart=true
autorestart=true
priority=10
stdout_events_enabled=true
stderr_events_enabled=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 100
events = PROCESS_LOG
result_handler = supervisor_stdout:event_handler
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论