first commit

This commit is contained in:
许 洋 2024-10-25 18:15:29 +08:00
commit 0ab8e2a9a8
96 changed files with 19861 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
logs/
data/
www/
services/nginx/ssl/

223
.env Normal file
View File

@ -0,0 +1,223 @@
#
# PHP source directory
#
SOURCE_DIR="/mnt/e/code/PHP"
#
# Runtime data directory
#
DATA_DIR=./data
#
# Container Timezone
#
TZ=Asia/Shanghai
#
# Container package fetch url
#
# Can be empty, followings or others:
# mirrors.163.com
# mirrors.aliyun.com
# mirrors.ustc.edu.cn
#
CONTAINER_PACKAGE_URL=mirrors.aliyun.com
# CONTAINER_PACKAGE_URL=mirrors.163.com
#
# Nginx
#
NGINX_VERSION=1.15.7-alpine
NGINX_HTTP_HOST_PORT=80
NGINX_HTTPS_HOST_PORT=443
NGINX_CONFD_DIR=./services/nginx/conf.d
NGINX_CONF_FILE=./services/nginx/nginx.conf
NGINX_FASTCGI_PHP_CONF=./services/nginx/fastcgi-php.conf
NGINX_FASTCGI_PARAMS=./services/nginx/fastcgi_params
NGINX_SSL_CERTIFICATE_DIR=./services/nginx/ssl
NGINX_LOG_DIR=./logs/nginx
# Available apps: certbot
NGINX_INSTALL_APPS=
#
# Openresty
#
OPENRESTY_VERSION=alpine
OPENRESTY_HTTP_HOST_PORT=80
OPENRESTY_HTTPS_HOST_PORT=443
OPENRESTY_CONFD_DIR=./services/openresty/conf.d
OPENRESTY_CONF_FILE=./services/openresty/openresty.conf
OPENRESTY_CONF_FASTCGIPARAMS_FILE=./services/openresty/fastcgi_params
OPENRESTY_LOG_DIR=./logs/nginx
#
# PHP7
#
# Available PHP_EXTENSIONS:
#
# pdo_mysql,zip,pcntl,mysqli,mbstring,exif,bcmath,calendar,
# sockets,gettext,shmop,sysvmsg,sysvsem,sysvshm,pdo_rebird,
# pdo_dblib,pdo_oci,pdo_odbc,pdo_pgsql,pgsql,oci8,odbc,dba,
# gd,intl,bz2,soap,xsl,xmlrpc,wddx,curl,readline,snmp,pspell,
# recode,tidy,gmp,imap,ldap,imagick,sqlsrv,mcrypt,opcache,
# redis,memcached,xdebug,swoole,pdo_sqlsrv,sodium,yaf,mysql,
# amqp,mongodb,event,rar,ast,yac,yaconf,msgpack,igbinary,
# seaslog,varnish
#
# You can let it empty to avoid installing any extensions,
# or install multi plugins as:
# PHP_EXTENSIONS=pdo_mysql,mysqli,gd,curl,opcache,
#
PHP_VERSION=7.2.19
PHP_PHP_CONF_FILE=./services/php/php.ini
PHP_FPM_CONF_FILE=./services/php/php-fpm.conf
PHP_LOG_DIR=./logs/php
PHP_LISTEN_PORT=9072
PHP_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,yaf,bcmath,mbstring,gettext,yaml,rar,redis,mongodb,phalcon
PHP71_VERSION=7.1.33
PHP71_PHP_CONF_FILE=./services/php71/php.ini
PHP71_FPM_CONF_FILE=./services/php71/php-fpm.conf
PHP71_LOG_DIR=./logs/php71
PHP71_LISTEN_PORT=9071
PHP71_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,yaf,bcmath,mbstring,gettext,yaml,rar,redis,mongodb,phalcon
PHP70_VERSION=7.0.30
PHP70_PHP_CONF_FILE=./services/php70/php.ini
PHP70_FPM_CONF_FILE=./services/php70/php-fpm.conf
PHP70_LOG_DIR=./logs/php72
PHP70_LISTEN_PORT=9070
PHP70_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,yaf,bcmath,mbstring,gettext,yaml,rar,redis,mongodb,phalcon
#
# PHP5.6
#
PHP56_VERSION=5.6.40
PHP56_PHP_CONF_FILE=./services/php56/php.ini
PHP56_FPM_CONF_FILE=./services/php56/php-fpm.conf
PHP56_LOG_DIR=./logs/php
PHP56_LISTEN_PORT=9056
PHP56_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,yaf,bcmath,mbstring,gettext,yaml,mongo,rar,redis,phalcon
#
# PHP5.4
#
PHP54_VERSION=5.4.45
PHP54_PHP_CONF_FILE=./services/php54/php.ini
PHP54_FPM_CONF_FILE=./services/php54/php-fpm.conf
PHP54_LOG_DIR=./logs/php
PHP54_LISTEN_PORT=9054
PHP54_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,bcmath,mbstring,gettext,yaml,redis,mongo
#
# PHP5.3
#
PHP53_VERSION=5.3.29
PHP53_PHP_CONF_FILE=./services/php53/php.ini
PHP53_FPM_CONF_FILE=./services/php53/php-fpm.conf
PHP53_LOG_DIR=./logs/php53
PHP53_LISTEN_PORT=9053
#PHP53_EXTENSIONS=gettext,yaml,redis,mongo
PHP53_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,bcmath,mbstring,gettext,yaml,redis,mongo
#
# RABBITMQ
#
RABBITMQ_VERSION=management
RABBITMQ_HOST_PORT_C=5672
RABBITMQ_HOST_PORT_S=15672
RABBITMQ_DEFAULT_USER=myuser
RABBITMQ_DEFAULT_PASS=mypass
#
# MONGODB
#
MONGODB_VERSION=4.1
MONGODB_HOST_PORT=27017
MONGODB_INITDB_ROOT_USERNAME=root
MONGODB_INITDB_ROOT_PASSWORD=123456
#
# ELASTICSEARCH
#
# Available ELASTICSEARCH_PLUGINS:
#
# amazon-ec2,analysis-icu,analysis-kuromoji,analysis-nori,
# analysis-phonetic,analysis-smartcn,analysis-stempel,
# analysis-ukrainian,discovery-azure-classic,discovery-ec2,
# discovery-file,discovery-gce,google-cloud-storage,
# ingest-attachment,ingest-geoip,ingest-user-agent,mapper-murmur3,
# mapper-size,microsoft-azure-storage,qa,repository-azure,
# repository-gcs,repository-hdfs,repository-s3,store-smb,
# analysis-ik,analysis-pinyin
#
# You can let it empty to avoid installing any plugins,
# or install plugins as:
# ELASTICSEARCH_PLUGINS=analysis-ik,analysis-pinyin
#
ELASTICSEARCH_VERSION=7.1.1
ELASTICSEARCH_CONF_FILE=./services/elasticsearch/elasticsearch.yml
ELASTICSEARCH_HOST_PORT_C=9200
ELASTICSEARCH_HOST_PORT_S=9300
ELASTICSEARCH_PLUGINS=
#
# KIBANA
#
KIBANA_VERSION=7.1.1
KIBANA_HOST=5601
#
# LOGSTASH
#
LOGSTASH_VERSION=7.1.1
LOGSTASH_HOST=5601
LOGSTASH_HOST_PORT_C=9600
LOGSTASH_HOST_PORT_S=5044
#
# MySQL8
#
MYSQL_VERSION=8.0.13
MYSQL_HOST_PORT=3306
MYSQL_ROOT_PASSWORD=123456
MYSQL_CONF_FILE=./services/mysql/mysql.cnf
#
# MySQL5
#
MYSQL5_VERSION=5.7.28
MYSQL5_HOST_PORT=3305
MYSQL5_ROOT_PASSWORD=123456
MYSQL5_CONF_FILE=./services/mysql5/mysql.cnf
#
# Redis
#
REDIS_VERSION=5.0.3-alpine
REDIS_HOST_PORT=6379
REDIS_CONF_FILE=./services/redis/redis.conf
#
# Memcached
#
MEMCACHED_VERSION=alpine
MEMCACHED_HOST_PORT=11211
MEMCACHED_CACHE_SIZE=128
#
# phpMyAdmin
#
PHPMYADMIN_HOST_PORT=8080
PHPMYADMIN_USER_CONF_FILE=./services/phpmyadmin/config.user.inc.php
PHPMYADMIN_PHP_CONF_FILE=./services/phpmyadmin/php-phpmyadmin.ini
#
# redisMyAdmin
#
REDISMYADMIN_HOST_PORT=8081
#
# AdminMongo
#
ADMINMONGO_HOST_PORT=1234

7
.gitattributes vendored Normal file
View File

@ -0,0 +1,7 @@
* text eol=lf
*.png binary
*.jpg binary
*.tgz binary
*.zip binary
*.gz binary

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.idea
.DS_Store
composer/
nohup.out
docker-compose.yml.*
www/*
!www/localhost/
logs/*

2
data/esdata/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
data/mongo/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
data/mysql/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
data/mysql5/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

145
docker-compose.yml Normal file
View File

@ -0,0 +1,145 @@
version: "3"
services:
nginx:
build:
context: ./services/nginx
args:
NGINX_VERSION: harbor.gaore.com/tools/nginx
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
NGINX_INSTALL_APPS: ${NGINX_INSTALL_APPS}
container_name: nginx_harbor
ports:
- "${NGINX_HTTP_HOST_PORT}:80"
- "${NGINX_HTTPS_HOST_PORT}:443"
# - "${NGINX_WS_HOST_PORT}:9000"
volumes:
- ${SOURCE_DIR}:/www/gaore:rw
- ${NGINX_SSL_CERTIFICATE_DIR}:/ssl:rw
- ${NGINX_CONFD_DIR}:/etc/nginx/conf.d/:rw
- ${NGINX_CONF_FILE}:/etc/nginx/nginx.conf:ro
# - ${PHP_HOSTS_FILE}:/etc/hosts:rw
# - /etc/hosts:/etc/hosts:rw
- ${NGINX_FASTCGI_PHP_CONF}:/etc/nginx/fastcgi-php.conf:ro
- ${NGINX_FASTCGI_PARAMS}:/etc/nginx/fastcgi_params:ro
- ${NGINX_LOG_DIR}:/var/log/nginx/:rw
environment:
TZ: "$TZ"
# restart: always
networks:
dev-network:
ipv4_address: 172.20.0.254
extra_hosts:
- "host.docker.internal:host-gateway"
php53:
build:
context: ./services/php53
args:
PHP_VERSION: harbor.gaore.com/tools/php53-fpm
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP53_EXTENSIONS}
TZ: "$TZ"
container_name: php53_harbor
ports:
- ${PHP53_LISTEN_PORT}:9000
env_file:
- ./docker.env
volumes:
- ${SOURCE_DIR}:/www/gaore:rw
- ./hosts:/etc/hosts:rw
- ${PHP53_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP53_FPM_CONF_FILE}:/usr/local/etc/php-fpm.conf:rw
- ${PHP53_LOG_DIR}:/var/log/php:rw
- ${DATA_DIR}/composer:/tmp/composer
# restart: always
cap_add:
- SYS_PTRACE
networks:
- dev-network
php56:
build:
context: ./services/php56
args:
PHP_VERSION: harbor.gaore.com/tools/php56-fpm
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP56_EXTENSIONS}
TZ: "$TZ"
container_name: php56_harbor
ports:
- ${PHP56_LISTEN_PORT}:9000
env_file:
- ./docker.env
volumes:
- ${SOURCE_DIR}:/www/gaore:rw
- ./hosts:/etc/hosts:rw
- ${PHP56_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP56_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${PHP56_LOG_DIR}:/var/log/php:rw
- ${DATA_DIR}/composer:/tmp/composer
# restart: always
cap_add:
- SYS_PTRACE
networks:
- dev-network
php70:
build:
context: ./services/php70
args:
PHP_VERSION: harbor.gaore.com/tools/php-7.0.5-fpm
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP70_EXTENSIONS}
TZ: "$TZ"
container_name: php70_harbor
ports:
- ${PHP70_LISTEN_PORT}:9000
env_file:
- ./docker.env
volumes:
- ${SOURCE_DIR}:/www/gaore:rw
- ./hosts:/etc/hosts:rw
- ${PHP70_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP70_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${PHP70_LOG_DIR}:/var/log/php:rw
- ${DATA_DIR}/composer:/tmp/composer
# restart: always
cap_add:
- SYS_PTRACE
networks:
- dev-network
php71:
build:
context: ./services/php71
args:
PHP_VERSION: harbor.gaore.com/tools/php71-fpm
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP71_EXTENSIONS}
TZ: "$TZ"
container_name: php71_harbor
ports:
- ${PHP71_LISTEN_PORT}:9000
env_file:
- ./docker.env
volumes:
- ${SOURCE_DIR}:/www/gaore:rw
- ./hosts:/etc/hosts:rw
- ${PHP71_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP71_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${PHP71_LOG_DIR}:/var/log/php:rw
- ${DATA_DIR}/composer:/tmp/composer
# restart: always
cap_add:
- SYS_PTRACE
networks:
- dev-network
networks:
dev-network:
external: false
ipam:
config:
- subnet: 172.20.0.0/24 # 指定子网

16
docker.env Normal file
View File

@ -0,0 +1,16 @@
GAORE_ENVIRONMENT=development
CENTER_RUNMODE=dev
GAORE_ABROAD_AREA=hk
GAORE_DEBUG=on
STATAPI_HTTP_HOST=0.0.0.0
CALLBACK_HTTP_HOST=0.0.0.0
STAT_HTTP_HOST=0.0.0.0
MKT_HTTP_HOST=0.0.0.0
STATAPI_PPROF_ENABLE=true
#http_proxy=http://host.docker.internal:1087
#https_proxy=http://host.docker.internal:1087
#ALL_PROXY=socks5://host.docker.internal:1080
NO_PROXY=gaore.com,gaore.com.hk

5
hosts Normal file
View File

@ -0,0 +1,5 @@
172.20.0.254 mkt.api.gaore.com mkt.gaore.com
172.20.0.254 callback.api.gaore.com
172.20.0.254 stat.gaore.com
172.20.0.254 msdk.gaore.com msdk.api.gaore.com game.gaore.com
192.168.1.202 sso.gaore.com admintest.gaore.com oss.gaore.com

20
services/nginx/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
ARG NGINX_VERSION
FROM ${NGINX_VERSION}
ARG TZ
ARG NGINX_VERSION
ARG CONTAINER_PACKAGE_URL
ARG NGINX_INSTALL_APPS
ENV INSTALL_APPS=",${NGINX_INSTALL_APPS},"
# RUN if [ "${CONTAINER_PACKAGE_URL}" != "" ]; then \
# sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories; \
# fi
RUN if [ -z "${INSTALL_APPS##*,certbot,*}" ]; then \
echo "---------- Install certbot ----------"; \
apk add --no-cache certbot; \
fi
WORKDIR /www

3
services/nginx/conf.d/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
!.gitignore
!certs/localhost/
!localhost.conf

View File

@ -0,0 +1,38 @@
# api-forwarding.com
server {
listen 80;
server_name api-forwarding.com;
index index.php;
root /www/gaore/api-forwarding.com/public;
access_log /var/log/nginx/api-forwarding.com.access.log main;
error_log /var/log/nginx/api-forwarding.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9056;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# www.gaore.com
server {
listen 80;
server_name apisdk.gaore.com;
index index.php;
root /www/gaore/www.gaore.com;
access_log /var/log/nginx/apisdk.gaore.com.access.log main;
error_log /var/log/nginx/apisdk.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,38 @@
# chat.gaore.com
server {
listen 80;
server_name chat.gaore.com;
index index.php;
root /www/gaore/chat.gaore.com/public;
access_log /var/log/nginx/chat.gaore.com.access.log main;
error_log /var/log/nginx/chat.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,38 @@
# game.gaore.com
server {
listen 80;
server_name game.gaore.com;
index index.php;
root /www/gaore/game.gaore.com/public;
access_log /var/log/nginx/game.gaore.com.access.log main;
error_log /var/log/nginx/game.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,158 @@
server {
listen 80;
server_name stat.gaore.com admin.stat.89yoo.com;
root /www/gaore/stat.gaore.com/public;
index index.php index.html index.htm;
access_log /var/log/nginx/nginx.stat.gaore.com.access.log main;
error_log /var/log/nginx/nginx.stat.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name new-opgroup.gaore.com callback.api.89yoo.com callback.api.gaore.com;
index index.php;
root /www/gaore/new-opgroup.gaore.com/public;
access_log /var/log/nginx/nginx.new-opgroup.gaore.com.access.log main;
error_log /var/log/nginx/nginx.new-opgroup.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9056;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name msdk.gaore.com;
index index.php;
root /www/gaore/msdk.gaore.com;
access_log /var/log/nginx/nginx.msdk.gaore.com.access.log main;
error_log /var/log/nginx/nginx.msdk.gaore.com.error.log warn;
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9056;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
# server{
# listen 80;
# server_name mkt.gaore.com mkt.api.gaore.com test.mkt.gaore.com;
# access_log /var/log/nginx/nginx.mkt.gaore.com.access.log main;
# error_log /var/log/nginx/nginx.mkt.gaore.com.error.log warn;
# location / {
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://host.docker.internal:9090/;
# }
# }
# server{
# listen 80;
# server_name admintest.gaore.com;
# access_log /var/log/nginx/nginx.admintest.gaore.com.access.log main;
# error_log /var/log/nginx/nginx.admintest.gaore.com.error.log warn;
# location / {
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://host.docker.internal:8088/;
# }
# }
# server{
# listen 80;
# server_name center-api.gaore.com;
# access_log /var/log/nginx/nginx.center-api.gaore.com.access.log main;
# error_log /var/log/nginx/nginx.center-api.gaore.com.error.log warn;
# location / {
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://host.docker.internal:8899/;
# }
# }
# server{
# listen 80;
# server_name sso.gaore.com;
# access_log /var/log/nginx/nginx.sso.gaore.com.access.log main;
# error_log /var/log/nginx/nginx.sso.gaore.com.error.log warn;
# location / {
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://host.docker.internal:9098/;
# }
# }

View File

@ -0,0 +1,38 @@
# h5.uu89.com
server {
listen 80;
server_name h5.uu89.com;
index index.php;
root /www/gaore/h5.uu89.com/public;
access_log /var/log/nginx/h5.uu89.com.access.log main;
error_log /var/log/nginx/h5.uu89.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,87 @@
server {
listen 80 default;
server_name localhost;
root /www/localhost;
index index.php index.html index.htm;
#charset koi8-r;
#access_log /dev/null;
access_log /var/log/nginx/localhost.access.log main;
error_log /var/log/nginx/localhost.error.log warn;
#error_page 404 /404.html;
# 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;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# location ~ \.php$ {
# fastcgi_pass php:9000;
# include fastcgi-php.conf;
# include fastcgi_params;
# }
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# server {
# listen 443 default ssl http2;
# server_name localhost;
# root /www/localhost;
# index index.php index.html index.htm;
# #charset koi8-r;
# #access_log /dev/null;
# access_log /var/log/nginx/localhost.access.log main;
# error_log /var/log/nginx/localhost.error.log warn;
# #error_page 404 /404.html;
# ssl_certificate /ssl/localhost/localhost.crt;
# ssl_certificate_key /ssl/localhost/localhost.key;
# # 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;
# }
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# location ~ \.php$ {
# fastcgi_pass php:9000;
# include fastcgi-php.conf;
# include fastcgi_params;
# }
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
# }

View File

@ -0,0 +1,40 @@
# mail.gaore.com
server {
listen 80;
server_name mail.gaore.com;
index index.php;
root /www/gaore/mail.gaore.com/public;
access_log /var/log/nginx/mail.gaore.com.access.log main;
error_log /var/log/nginx/mail.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9053;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# open.api.gaore.com
server {
listen 80;
server_name open.api.gaore.com;
index index.php;
root /www/gaore/open.api.gaore.com/public;
access_log /var/log/nginx/open.api.gaore.com.access.log main;
error_log /var/log/nginx/open.api.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# opgroup.gaore.com
server {
listen 80;
server_name opgroup.gaore.com;
index index.php;
root /www/gaore/op-group.gaore.com;
access_log /var/log/nginx/opgroup.gaore.com.access.log main;
error_log /var/log/nginx/opgroup.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9053;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# passport.gaore.com
server {
listen 80;
server_name passport.gaore.com;
index index.php;
root /www/gaore/passport.gaore.com;
access_log /var/log/nginx/passport.gaore.com.access.log main;
error_log /var/log/nginx/passport.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# pay.gaore.com
server {
listen 80;
server_name pay.gaore.com;
index index.php;
root /www/gaore/pay.gaore.com/public;
access_log /var/log/nginx/pay.gaore.com.access.log main;
error_log /var/log/nginx/pay.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9071;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# script.gaore.com
server {
listen 80;
server_name script.gaore.com;
index index.php;
root /www/gaore/script.gaore.com;
access_log /var/log/nginx/script.gaore.com.access.log main;
error_log /var/log/nginx/script.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9053;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# sdk.gaore.com
server {
listen 80;
server_name sdk.gaore.com;
index index.php;
root /www/gaore/sdk.gaore.com/public;
access_log /var/log/nginx/sdk.gaore.com.access.log main;
error_log /var/log/nginx/sdk.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,40 @@
# web.gaore.com
server {
listen 80;
server_name web.gaore.com;
index index.php;
root /www/gaore/web.gaore.com/public;
access_log /var/log/nginx/web.gaore.com.access.log main;
error_log /var/log/nginx/web.gaore.com.error.log warn;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
#set $request_path $uri;
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php(.*)$ {
fastcgi_pass host.docker.internal:9070;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param QUAN_DEBUG On;
fastcgi_param GAORE_ENVIRONMENT development;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

View File

@ -0,0 +1,14 @@
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
#fastcgi_param PATH_INFO $path_info;
fastcgi_read_timeout 3600;
fastcgi_index index.php;

View File

@ -0,0 +1,26 @@
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

45
services/nginx/nginx.conf Normal file
View File

@ -0,0 +1,45 @@
user nginx;
worker_processes 2;
pid /var/run/nginx.pid;
error_log /var/log/nginx/nginx.error.log warn;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main escape=json ' \r\n-----------------------------------------\r\n '
' REMOTE_ADDR : $remote_addr \r\n '
' REMOTE_USER : $remote_user \r\n '
' TIME_LOCAL : $time_local \r\n '
' REQUEST : $request \r\n '
' REQUEST_BODY : $request_body \r\n '
' HTTP_HOST : $http_host \r\n '
' UPSTREAM_STATUS : $upstream_status \r\n '
' HTTP_REFERER : $http_referer \r\n '
' HTTP_USER_AGENT : $http_user_agent \r\n '
' UPSTREAM_RESPONSE_TIME : $upstream_response_time \r\n '
' REQUEST_TIME : $request_time \r\n '
' -----------------------------------------\r\n ';
access_log /dev/null;
#access_log /var/log/dnmp/nginx.access.log main;
# hide verson string
server_tokens off;
sendfile on;
#tcp_nopush on;
client_max_body_size 100M;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}

View File

@ -0,0 +1,30 @@
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024
echo "Create server certificate signing request..."
SUBJECT="/C=US/ST=Mars/L=iTranswarp/O=iTranswarp/OU=iTranswarp/CN=$DOMAIN"
openssl req -new -subj $SUBJECT -key $DOMAIN.key -out $DOMAIN.csr
echo "Remove password..."
mv $DOMAIN.key $DOMAIN.origin.key
openssl rsa -in $DOMAIN.origin.key -out $DOMAIN.key
echo "Sign SSL certificate..."
openssl x509 -req -days 3650 -in $DOMAIN.csr -signkey $DOMAIN.key -out $DOMAIN.crt
mkdir -p $DOMAIN
mv $DOMAIN.* $DOMAIN
echo "Done!"

View File

@ -0,0 +1,15 @@
-----BEGIN CERTIFICATE-----
MIICVTCCAb4CCQDAjEyILRN30zANBgkqhkiG9w0BAQsFADBvMQswCQYDVQQGEwJV
UzENMAsGA1UECAwETWFyczETMBEGA1UEBwwKaVRyYW5zd2FycDETMBEGA1UECgwK
aVRyYW5zd2FycDETMBEGA1UECwwKaVRyYW5zd2FycDESMBAGA1UEAwwJbG9jYWxo
b3N0MB4XDTE4MDkyNTAyMzAyNVoXDTI4MDkyMjAyMzAyNVowbzELMAkGA1UEBhMC
VVMxDTALBgNVBAgMBE1hcnMxEzARBgNVBAcMCmlUcmFuc3dhcnAxEzARBgNVBAoM
CmlUcmFuc3dhcnAxEzARBgNVBAsMCmlUcmFuc3dhcnAxEjAQBgNVBAMMCWxvY2Fs
aG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvF1hXtpa26dj8qKq4rQ8
DYHC36UcghZp7JF8Q9M1ga4+R+M37Tt7rbkVSCbPfBYN0lGJ12CqQUye8wfJ/skr
ol7KJcyfj5Z/z3IZSLegCOkJfxF5vNKzArbb+R2+ek2WdKuTGfOdbj07y1Q52HsS
iOcrl7kUzmkYvxMEA2bqkPsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAeuljNAc0b
wNQCRRzJmfmW2I9kKGQVdHeJwzNE5D3jXlUbUXxBVpw5db548v6TSszicQV1nNav
HiRQsQIbciSdRL7JFSFBbXURVD9LYu7SjtVb5sviZht1t47OpdT/GDYDkx40I3SK
qtCcfeZ0GVupkCCZZM4C26hMZz+LVUaCmw==
-----END CERTIFICATE-----

View File

@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXwIBAAKBgQC8XWFe2lrbp2PyoqritDwNgcLfpRyCFmnskXxD0zWBrj5H4zft
O3utuRVIJs98Fg3SUYnXYKpBTJ7zB8n+ySuiXsolzJ+Pln/PchlIt6AI6Ql/EXm8
0rMCttv5Hb56TZZ0q5MZ851uPTvLVDnYexKI5yuXuRTOaRi/EwQDZuqQ+wIDAQAB
AoGBALIcFiMLk1gZen+GYtFEnXgkF7FDPaagLP59PqQfhXue19M/vbU7RqIo3T/B
OvXZIK6bXRxjkfl2yuGAnvalH/Shz/YdDtwtItgyYr4rteU5wJnPijPa2ebYXxNV
wxq+9iyZs2vhhbbRGhFxREVE8iu2RnLY12CRxykGmxlWcNDZAkEA9CjA14Ym9gN/
XwZ8PNe+a/2fe8U0O86VnanOK1G5k5dsZkOW0O/5u622rMlGJw/S+YCBJ+8sOhFL
QTxlVGPCtQJBAMV/79lWoGBGnpoB+o9lc1nBUCCxGmVzywSOrTjIquwegTvjMUUM
yoqEDWC4fNdoFtaFZ12tPk42NYC4BdbU4u8CQQCqOAdJurNK7GFOZH0VBewx6Z3Y
ckHaOEpCovGjbdSNOxJNsW1huQxIdfFXQPNxpCyX2akxqCMTUJ9AmdSjIvHJAkEA
qKajjpimwxALB8CA0krzwcWOQxx5SgEjcHTV/xN8wb0a5qUPwcM2gipZsipYkSlV
t0KcDiaOegNYlN6QPe/1CQJBALtRggJf4bMgjG9vsz/zhe9egCtuUifKfo5LLvI+
Xua1SY6XGL0Bf8TOGaNXc6Ye9H5abp7q/bZlZ+dGgJ3SJCY=
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,27 @@
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

View File

@ -0,0 +1,56 @@
# nginx.conf -- docker-openresty
#
# This file is installed to:
# `/usr/local/openresty/nginx/conf/nginx.conf`
# and is the file loaded by nginx at startup,
# unless the user specifies otherwise.
#
# It tracks the upstream OpenResty's `nginx.conf`, but removes the `server`
# section and adds this directive:
# `include /etc/nginx/conf.d/*.conf;`
#
# The `docker-openresty` file `nginx.vh.default.conf` is copied to
# `/etc/nginx/conf.d/default.conf`. It contains the `server section
# of the upstream `nginx.conf`.
#
# See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files
#
#user www-data;
worker_processes 1;
error_log /var/log/nginx/openresly.error.log warn;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'"$request_body" $request_time $upstream_response_time';
access_log logs/access.log main;
#隐藏版本号
server_tokens off;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}

22
services/php53/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
ARG PHP_VERSION
FROM ${PHP_VERSION}
ARG TZ
ARG PHP_EXTENSIONS
ARG CONTAINER_PACKAGE_URL
COPY ./docker-php-ext-enable /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-php-ext-enable
COPY ./extensions /tmp/extensions
WORKDIR /tmp/extensions
RUN chmod +x install.sh \
&& sh install.sh \
&& rm -fr /tmp/extensions
# php image's www-data user uid & gid are 82, change them to 1000 (primary user)
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
# Use www-data to run the first process
USER "www-data"
WORKDIR /www

View File

@ -0,0 +1,8 @@
#!/bin/bash
ext=$1
line="extension=$ext.so"
ini="/usr/local/etc/php/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
if ! grep -q "$line" "$ini" 2>/dev/null; then
echo "$line" >> "$ini"
fi

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,504 @@
#!/bin/sh
export MC="-j$(nproc)"
echo
echo "============================================"
echo "Install extensions from : install.sh"
echo "PHP version : ${PHP_VERSION}"
echo "Extra Extensions : ${PHP_EXTENSIONS}"
echo "Multicore Compilation : ${MC}"
echo "Container package url : ${CONTAINER_PACKAGE_URL}"
echo "Work directory : ${PWD}"
echo "============================================"
echo
if [ "${PHP_EXTENSIONS}" != "" ]; then
apt-get -y install unzip openssl libssl-dev
fi
export EXTENSIONS=",${PHP_EXTENSIONS},"
#
# Check if current php version is greater than or equal to
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
# Return : 1 if greater than or equal to, 0 if less than
#
isPhpVersionGreaterOrEqual()
{
return 0
}
# docker-php-ext-enable()
# {
# ext=$1
# line="extension=$ext.so"
# ini="/usr/local/ext/php/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
# if ! grep -q "$line" "$ini" 2 > /dev/null; then
# echo "$line" >> "$ini"
# fi
# }
#
# Install extension from package file(.tgz),
# For example:
#
# installExtensionFromTgz redis-4.1.1
#
# Param 1: Package name with version
# Param 2: enable options
#
installExtensionFromTgz()
{
tgzName=$1
extensionName="${tgzName%%-*}"
mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable ${extensionName}
}
if [ -z "${EXTENSIONS##*,pdo_mysql,*}" ]; then
echo "---------- Install pdo_mysql ----------"
docker-php-ext-install pdo_mysql
docker-php-ext-install mysql
fi
if [ -z "${EXTENSIONS##*,pcntl,*}" ]; then
echo "---------- Install pcntl ----------"
docker-php-ext-install pcntl
fi
if [ -z "${EXTENSIONS##*,mysqli,*}" ]; then
echo "---------- Install mysqli ----------"
docker-php-ext-install mysqli
fi
if [ -z "${EXTENSIONS##*,mbstring,*}" ]; then
echo "---------- mbstring is installed ----------"
fi
if [ -z "${EXTENSIONS##*,exif,*}" ]; then
echo "---------- Install exif ----------"
docker-php-ext-install exif
fi
if [ -z "${EXTENSIONS##*,bcmath,*}" ]; then
echo "---------- Install bcmath ----------"
docker-php-ext-install bcmath
fi
if [ -z "${EXTENSIONS##*,calendar,*}" ]; then
echo "---------- Install calendar ----------"
docker-php-ext-install calendar
fi
if [ -z "${EXTENSIONS##*,zend_test,*}" ]; then
echo "---------- Install zend_test ----------"
docker-php-ext-install zend_test
fi
if [ -z "${EXTENSIONS##*,opcache,*}" ]; then
echo "---------- Install opcache ----------"
docker-php-ext-install opcache
fi
if [ -z "${EXTENSIONS##*,sockets,*}" ]; then
echo "---------- Install sockets ----------"
docker-php-ext-install sockets
fi
if [ -z "${EXTENSIONS##*,gettext,*}" ]; then
echo "---------- Install gettext ----------"
docker-php-ext-install gettext
fi
if [ -z "${EXTENSIONS##*,shmop,*}" ]; then
echo "---------- Install shmop ----------"
docker-php-ext-install shmop
fi
if [ -z "${EXTENSIONS##*,sysvmsg,*}" ]; then
echo "---------- Install sysvmsg ----------"
docker-php-ext-install sysvmsg
fi
if [ -z "${EXTENSIONS##*,sysvsem,*}" ]; then
echo "---------- Install sysvsem ----------"
docker-php-ext-install sysvsem
fi
if [ -z "${EXTENSIONS##*,sysvshm,*}" ]; then
echo "---------- Install sysvshm ----------"
docker-php-ext-install sysvshm
fi
if [ -z "${EXTENSIONS##*,pdo_firebird,*}" ]; then
echo "---------- Install pdo_firebird ----------"
docker-php-ext-install pdo_firebird
fi
if [ -z "${EXTENSIONS##*,pdo_dblib,*}" ]; then
echo "---------- Install pdo_dblib ----------"
docker-php-ext-install pdo_dblib
fi
if [ -z "${EXTENSIONS##*,pdo_oci,*}" ]; then
echo "---------- Install pdo_oci ----------"
docker-php-ext-install pdo_oci
fi
if [ -z "${EXTENSIONS##*,pdo_odbc,*}" ]; then
echo "---------- Install pdo_odbc ----------"
docker-php-ext-install pdo_odbc
fi
if [ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]; then
echo "---------- Install pdo_pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install pdo_pgsql
fi
if [ -z "${EXTENSIONS##*,pgsql,*}" ]; then
echo "---------- Install pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install pgsql
fi
if [ -z "${EXTENSIONS##*,oci8,*}" ]; then
echo "---------- Install oci8 ----------"
docker-php-ext-install oci8
fi
if [ -z "${EXTENSIONS##*,odbc,*}" ]; then
echo "---------- Install odbc ----------"
docker-php-ext-install odbc
fi
if [ -z "${EXTENSIONS##*,dba,*}" ]; then
echo "---------- Install dba ----------"
docker-php-ext-install dba
fi
if [ -z "${EXTENSIONS##*,interbase,*}" ]; then
echo "---------- Install interbase ----------"
echo "Alpine linux do not support interbase/firebird!!!"
#docker-php-ext-install interbase
fi
if [ -z "${EXTENSIONS##*,gd,*}" ]; then
echo "---------- Install gd ----------"
apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd
fi
if [ -z "${EXTENSIONS##*,intl,*}" ]; then
echo "---------- Install intl ----------"
apk add --no-cache icu-dev
docker-php-ext-install intl
fi
if [ -z "${EXTENSIONS##*,bz2,*}" ]; then
echo "---------- Install bz2 ----------"
apk add --no-cache bzip2-dev
docker-php-ext-install bz2
fi
if [ -z "${EXTENSIONS##*,soap,*}" ]; then
echo "---------- Install soap ----------"
apk add --no-cache libxml2-dev
docker-php-ext-install soap
fi
if [ -z "${EXTENSIONS##*,xsl,*}" ]; then
echo "---------- Install xsl ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install xsl
fi
if [ -z "${EXTENSIONS##*,xmlrpc,*}" ]; then
echo "---------- Install xmlrpc ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install xmlrpc
fi
if [ -z "${EXTENSIONS##*,wddx,*}" ]; then
echo "---------- Install wddx ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install wddx
fi
if [ -z "${EXTENSIONS##*,curl,*}" ]; then
echo "---------- curl is installed ----------"
fi
if [ -z "${EXTENSIONS##*,readline,*}" ]; then
echo "---------- Install readline ----------"
apk add --no-cache readline-dev
apk add --no-cache libedit-dev
docker-php-ext-install readline
fi
if [ -z "${EXTENSIONS##*,snmp,*}" ]; then
echo "---------- Install snmp ----------"
apk add --no-cache net-snmp-dev
docker-php-ext-install snmp
fi
if [ -z "${EXTENSIONS##*,pspell,*}" ]; then
echo "---------- Install pspell ----------"
apk add --no-cache aspell-dev
apk add --no-cache aspell-en
docker-php-ext-install pspell
fi
if [ -z "${EXTENSIONS##*,recode,*}" ]; then
echo "---------- Install recode ----------"
apk add --no-cache recode-dev
docker-php-ext-install recode
fi
if [ -z "${EXTENSIONS##*,tidy,*}" ]; then
echo "---------- Install tidy ----------"
apk add --no-cache tidyhtml-dev
# Fix: https://github.com/htacg/tidy-html5/issues/235
ln -s /usr/include/tidybuffio.h /usr/include/buffio.h
docker-php-ext-install tidy
fi
if [ -z "${EXTENSIONS##*,gmp,*}" ]; then
echo "---------- Install gmp ----------"
apk add --no-cache gmp-dev
docker-php-ext-install gmp
fi
if [ -z "${EXTENSIONS##*,imap,*}" ]; then
echo "---------- Install imap ----------"
apk add --no-cache imap-dev
docker-php-ext-configure imap --with-imap --with-imap-ssl
docker-php-ext-install imap
fi
if [ -z "${EXTENSIONS##*,ldap,*}" ]; then
echo "---------- Install ldap ----------"
apk add --no-cache ldb-dev
apk add --no-cache openldap-dev
docker-php-ext-install ldap
fi
if [ -z "${EXTENSIONS##*,yaml,*}" ]; then
echo "---------- Install yaml ----------"
apt-get -y install libyaml-dev
installExtensionFromTgz yaml-1.2.0
fi
if [ -z "${EXTENSIONS##*,imagick,*}" ]; then
echo "---------- Install imagick ----------"
apk add --no-cache file-dev
apk add --no-cache imagemagick-dev
printf "\n" | pecl install imagick-3.4.4
docker-php-ext-enable imagick
fi
if [ -z "${EXTENSIONS##*,rar,*}" ]; then
echo "---------- Install rar ----------"
printf "\n" | pecl install rar
docker-php-ext-enable rar
fi
if [ -z "${EXTENSIONS##*,ast,*}" ]; then
echo "---------- Install ast ----------"
printf "\n" | pecl install ast
docker-php-ext-enable ast
fi
if [ -z "${EXTENSIONS##*,msgpack,*}" ]; then
echo "---------- Install msgpack ----------"
printf "\n" | pecl install msgpack
docker-php-ext-enable msgpack
fi
if [ -z "${EXTENSIONS##*,igbinary,*}" ]; then
echo "---------- Install igbinary ----------"
printf "\n" | pecl install igbinary
docker-php-ext-enable igbinary
fi
if [ -z "${EXTENSIONS##*,yac,*}" ]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
fi
if [ -z "${EXTENSIONS##*,yaconf,*}" ]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
fi
if [ -z "${EXTENSIONS##*,seaslog,*}" ]; then
echo "---------- Install seaslog ----------"
printf "\n" | pecl install seaslog
docker-php-ext-enable seaslog
fi
if [ -z "${EXTENSIONS##*,varnish,*}" ]; then
echo "---------- Install varnish ----------"
apk add --no-cache varnish
printf "\n" | pecl install varnish
docker-php-ext-enable varnish
fi
if [ -z "${EXTENSIONS##*,mcrypt,*}" ]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev \
&& docker-php-ext-install mcrypt
fi
if [ -z "${EXTENSIONS##*,mysql,*}" ]; then
echo "---------- Install mysql ----------"
docker-php-ext-install mysql
fi
if [ -z "${EXTENSIONS##*,sodium,*}" ]; then
echo "---------- Install sodium ----------"
apk add --no-cache libsodium-dev
docker-php-ext-install sodium
fi
if [ -z "${EXTENSIONS##*,amqp,*}" ]; then
echo "---------- Install amqp ----------"
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.9.4
fi
if [ -z "${EXTENSIONS##*,redis,*}" ]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-3.1.2
fi
if [ -z "${EXTENSIONS##*,apcu,*}" ]; then
echo "---------- Install apcu ----------"
installExtensionFromTgz apcu-5.1.17
fi
if [ -z "${EXTENSIONS##*,memcached,*}" ]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
isPhpVersionGreaterOrEqual 7 0
if [ "$?" = "1" ]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [ -z "${EXTENSIONS##*,xdebug,*}" ]; then
echo "---------- Install xdebug ----------"
isPhpVersionGreaterOrEqual 7 0
if [ "$?" = "1" ]; then
installExtensionFromTgz xdebug-2.6.1
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [ -z "${EXTENSIONS##*,event,*}" ]; then
echo "---------- Install event ----------"
apk add --no-cache libevent-dev
export is_sockets_installed=$(php -r "echo extension_loaded('sockets');")
if [ "${is_sockets_installed}" = "" ]; then
echo "---------- event is depend on sockets, install sockets first ----------"
docker-php-ext-install sockets
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.3 "--ini-name event.ini"
fi
if [ -z "${EXTENSIONS##*,mongodb,*}" ]; then
echo "---------- Install mongodb ----------"
installExtensionFromTgz mongodb-1.5.5
fi
if [ -z "${EXTENSIONS##*,mongo,*}" ]; then
echo "---------- Install mongo ----------"
installExtensionFromTgz mongo-1.6.16
fi
if [ -z "${EXTENSIONS##*,yaf,*}" ]; then
echo "---------- Install yaf ----------"
isPhpVersionGreaterOrEqual 7 0
if [ "$?" = "1" ]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [ -z "${EXTENSIONS##*,phalcon,*}" ]; then
echo "---------- Install phalcon ----------"
mkdir cphalcon
tar -xf cphalcon-3.1.0.tgz -C cphalcon --strip-components=1
( cd cphalcon/build/php5/64bits && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable phalcon
fi
if [ -z "${EXTENSIONS##*,swoole,*}" ]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 7 0
if [ "$?" = "1" ]; then
installExtensionFromTgz swoole-4.4.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
if [ -z "${EXTENSIONS##*,zip,*}" ]; then
echo "---------- Install zip ----------"
isPhpVersionGreaterOrEqual 7 3
# Fix: https://github.com/docker-library/php/issues/797
if [ "$?" = "1" ]; then
apk add --no-cache libzip-dev
docker-php-ext-configure zip --with-libzip=/usr/include
fi
docker-php-ext-install zip
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

133
services/php53/php-fpm.conf Normal file
View File

@ -0,0 +1,133 @@
; This file was initially adapated from the output of: (on PHP 5.6)
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default
[global]
error_log = /proc/self/fd/2
log_level = warning
daemonize = no
[www]
; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2
user = www-data
group = www-data
listen = 9000
pm = static
pm.max_children = 60
pm.start_servers = 6
pm.min_spare_servers = 2
pm.max_spare_servers = 5
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/php/fpm53.slow.log
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 3
; Depth of slow log stack trace.
; Default Value: 20
;request_slowlog_trace_depth = 20
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
; catch_workers_output = yes
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
; clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; execute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
env[GAORE_ENVIRONMENT]=$GAORE_ENVIRONMENT
env[GAORE_ABROAD_AREA]=$GAORE_ABROAD_AREA
env[CENTER_RUNMODE]=$CENTER_RUNMODE
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

1947
services/php53/php.ini Normal file

File diff suppressed because it is too large Load Diff

44
services/php56/Dockerfile Normal file
View File

@ -0,0 +1,44 @@
ARG PHP_VERSION=php:5.6.36-fpm-alpine3.4
FROM ${PHP_VERSION}
ARG TZ=Asia/Shanghai
ARG PHP_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,yaf,bcmath,mbstring,gettext,yaml,mongo,rar,redis,phalcon
ARG CONTAINER_PACKAGE_URL=mirrors.163.com
# RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories
COPY ./extensions /tmp/extensions
WORKDIR /tmp/extensions
RUN chmod +x install.sh \
&& sh install.sh \
&& rm -fr /tmp/extensions
RUN apt-get install tzdata \
&& cp "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone
# Debian/Ubuntu 上有内置的iconv不需要这个了
# Fix: https://github.com/docker-library/php/issues/240
# RUN apt-get update && apt-get install gnu-libiconv
#RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.10/community/ --allow-untrusted
# ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
# php image's www-data user uid & gid are 82, change them to 1000 (primary user)
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
RUN chown www-data:www-data /usr/local/etc/php/conf.d
RUN command touch /xdebug_configured
RUN chown www-data:www-data /xdebug_configured
# Use www-data to run the first process
USER www-data
WORKDIR /www

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,535 @@
#!/bin/sh
export MC="-j$(nproc)"
echo
echo "============================================"
echo "Install extensions from : install.sh"
echo "PHP version : ${PHP_VERSION}"
echo "Extra Extensions : ${PHP_EXTENSIONS}"
echo "Multicore Compilation : ${MC}"
echo "Container package url : ${CONTAINER_PACKAGE_URL}"
echo "Work directory : ${PWD}"
echo "============================================"
echo
if [ "${PHP_EXTENSIONS}" != "" ]; then
apk add --no-cache autoconf g++ libtool make curl-dev gettext-dev linux-headers
fi
export EXTENSIONS=",${PHP_EXTENSIONS},"
#
# Check if current php version is greater than or equal to
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
# Return : 1 if greater than or equal to, 0 if less than
#
isPhpVersionGreaterOrEqual()
{
local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")
if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
return 1;
else
return 0;
fi
}
#
# Install extension from package file(.tgz),
# For example:
#
# installExtensionFromTgz redis-4.1.1
#
# Param 1: Package name with version
# Param 2: enable options
#
installExtensionFromTgz()
{
tgzName=$1
extensionName="${tgzName%%-*}"
mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable ${extensionName} $2
}
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
docker-php-ext-install ${MC} pdo_mysql
docker-php-ext-install ${MC} mysql
fi
if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then
echo "---------- Install pcntl ----------"
docker-php-ext-install ${MC} pcntl
fi
if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then
echo "---------- Install mysqli ----------"
docker-php-ext-install ${MC} mysqli
fi
if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then
echo "---------- mbstring is installed ----------"
fi
if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then
echo "---------- Install exif ----------"
docker-php-ext-install ${MC} exif
fi
if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then
echo "---------- Install bcmath ----------"
docker-php-ext-install ${MC} bcmath
fi
if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then
echo "---------- Install calendar ----------"
docker-php-ext-install ${MC} calendar
fi
if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then
echo "---------- Install zend_test ----------"
docker-php-ext-install ${MC} zend_test
fi
if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then
echo "---------- Install opcache ----------"
docker-php-ext-install opcache
fi
if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then
echo "---------- Install sockets ----------"
docker-php-ext-install ${MC} sockets
fi
if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then
echo "---------- Install gettext ----------"
docker-php-ext-install ${MC} gettext
fi
if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then
echo "---------- Install shmop ----------"
docker-php-ext-install ${MC} shmop
fi
if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then
echo "---------- Install sysvmsg ----------"
docker-php-ext-install ${MC} sysvmsg
fi
if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then
echo "---------- Install sysvsem ----------"
docker-php-ext-install ${MC} sysvsem
fi
if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then
echo "---------- Install sysvshm ----------"
docker-php-ext-install ${MC} sysvshm
fi
if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then
echo "---------- Install pdo_firebird ----------"
docker-php-ext-install ${MC} pdo_firebird
fi
if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then
echo "---------- Install pdo_dblib ----------"
docker-php-ext-install ${MC} pdo_dblib
fi
if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then
echo "---------- Install pdo_oci ----------"
docker-php-ext-install ${MC} pdo_oci
fi
if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then
echo "---------- Install pdo_odbc ----------"
docker-php-ext-install ${MC} pdo_odbc
fi
if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then
echo "---------- Install pdo_pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pdo_pgsql
fi
if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then
echo "---------- Install pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pgsql
fi
if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then
echo "---------- Install oci8 ----------"
docker-php-ext-install ${MC} oci8
fi
if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then
echo "---------- Install odbc ----------"
docker-php-ext-install ${MC} odbc
fi
if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then
echo "---------- Install dba ----------"
docker-php-ext-install ${MC} dba
fi
if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then
echo "---------- Install interbase ----------"
echo "Alpine linux do not support interbase/firebird!!!"
#docker-php-ext-install ${MC} interbase
fi
if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install ${MC} gd
fi
if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then
echo "---------- Install intl ----------"
apk add --no-cache icu-dev
docker-php-ext-install ${MC} intl
fi
if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then
echo "---------- Install bz2 ----------"
apk add --no-cache bzip2-dev
docker-php-ext-install ${MC} bz2
fi
if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then
echo "---------- Install soap ----------"
apk add --no-cache libxml2-dev
docker-php-ext-install ${MC} soap
fi
if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then
echo "---------- Install xsl ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} xsl
fi
if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then
echo "---------- Install xmlrpc ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} xmlrpc
fi
if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then
echo "---------- Install wddx ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} wddx
fi
if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then
echo "---------- curl is installed ----------"
fi
if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then
echo "---------- Install readline ----------"
apk add --no-cache readline-dev
apk add --no-cache libedit-dev
docker-php-ext-install ${MC} readline
fi
if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then
echo "---------- Install snmp ----------"
apk add --no-cache net-snmp-dev
docker-php-ext-install ${MC} snmp
fi
if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then
echo "---------- Install pspell ----------"
apk add --no-cache aspell-dev
apk add --no-cache aspell-en
docker-php-ext-install ${MC} pspell
fi
if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then
echo "---------- Install recode ----------"
apk add --no-cache recode-dev
docker-php-ext-install ${MC} recode
fi
if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then
echo "---------- Install tidy ----------"
apk add --no-cache tidyhtml-dev
# Fix: https://github.com/htacg/tidy-html5/issues/235
ln -s /usr/include/tidybuffio.h /usr/include/buffio.h
docker-php-ext-install ${MC} tidy
fi
if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then
echo "---------- Install gmp ----------"
apk add --no-cache gmp-dev
docker-php-ext-install ${MC} gmp
fi
if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then
echo "---------- Install imap ----------"
apk add --no-cache imap-dev
docker-php-ext-configure imap --with-imap --with-imap-ssl
docker-php-ext-install ${MC} imap
fi
if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then
echo "---------- Install ldap ----------"
apk add --no-cache ldb-dev
apk add --no-cache openldap-dev
docker-php-ext-install ${MC} ldap
fi
if [[ -z "${EXTENSIONS##*,yaml,*}" ]]; then
echo "---------- Install yaml ----------"
apk add --no-cache yaml-dev
installExtensionFromTgz yaml-1.2.0
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
apk add --no-cache file-dev
apk add --no-cache imagemagick-dev
printf "\n" | pecl install imagick-3.4.4
docker-php-ext-enable imagick
fi
if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then
echo "---------- Install rar ----------"
printf "\n" | pecl install rar
docker-php-ext-enable rar
fi
if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then
echo "---------- Install ast ----------"
printf "\n" | pecl install ast
docker-php-ext-enable ast
fi
if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then
echo "---------- Install msgpack ----------"
printf "\n" | pecl install msgpack
docker-php-ext-enable msgpack
fi
if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then
echo "---------- Install igbinary ----------"
printf "\n" | pecl install igbinary
docker-php-ext-enable igbinary
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
fi
if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then
echo "---------- Install seaslog ----------"
printf "\n" | pecl install seaslog
docker-php-ext-enable seaslog
fi
if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
echo "---------- Install varnish ----------"
apk add --no-cache varnish
printf "\n" | pecl install varnish
docker-php-ext-enable varnish
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------"
else
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev \
&& docker-php-ext-install ${MC} mcrypt
fi
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
fi
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
apk add --no-cache libsodium-dev
docker-php-ext-install ${MC} sodium
fi
fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.9.4
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-3.1.2
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.6.1
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
echo "---------- Install event ----------"
apk add --no-cache libevent-dev
export is_sockets_installed=$(php -r "echo extension_loaded('sockets');")
if [[ "${is_sockets_installed}" = "" ]]; then
echo "---------- event is depend on sockets, install sockets first ----------"
docker-php-ext-install sockets
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.3 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
installExtensionFromTgz mongodb-1.5.5
fi
if [[ -z "${EXTENSIONS##*,mongo,*}" ]]; then
echo "---------- Install mongo ----------"
installExtensionFromTgz mongo-1.6.16
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
mkdir cphalcon
tar -xf cphalcon-3.1.0.tgz -C cphalcon --strip-components=1
( cd cphalcon/build/php5/64bits && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable phalcon
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.4.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
echo "---------- Install zip ----------"
isPhpVersionGreaterOrEqual 7 3
# Fix: https://github.com/docker-library/php/issues/797
if [[ "$?" = "1" ]]; then
apk add --no-cache libzip-dev
docker-php-ext-configure zip --with-libzip=/usr/include
fi
docker-php-ext-install ${MC} zip
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

423
services/php56/php-fpm.conf Normal file
View File

@ -0,0 +1,423 @@
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or NONE) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = www-data
;group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1
; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool processes will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; process.priority = -19
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
; or group is differrent than the master process user. It allows to create process
; core dump and ptrace the process for the pool user.
; Default Value: no
; process.dumpable = yes
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 10
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in µs of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: /usr/local/share/php/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong
; The access log file
; Default: not set
;access.log = log/$pool.access.log
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: output header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/php/fpm56.slow.log
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 3
; Depth of slow log stack trace.
; Default Value: 20
;request_slowlog_trace_depth = 20
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
catch_workers_output = yes
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; execute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

1947
services/php56/php.ini Normal file

File diff suppressed because it is too large Load Diff

32
services/php70/Dockerfile Normal file
View File

@ -0,0 +1,32 @@
ARG PHP_VERSION
FROM ${PHP_VERSION}
ARG TZ
ARG PHP_EXTENSIONS
ARG CONTAINER_PACKAGE_URL
COPY ./extensions /tmp/extensions
WORKDIR /tmp/extensions
RUN chmod +x install.sh \
&& sh install.sh
# RUN rm -fr /tmp/extensions
# 添加社区仓库 经测试3.5可以
RUN echo "http://${CONTAINER_PACKAGE_URL}/alpine/v3.5/community" >> /etc/apk/repositories
RUN apk update && apk add --no-cache iputils
RUN apk add --no-cache openssl && apk --no-cache add libzip-dev \
&& docker-php-ext-configure zip --with-libzip=/usr/include \
&& docker-php-ext-install zip
RUN apk update && apk --no-cache add shadow
# php image's www-data user uid & gid are 82, change them to 1000 (primary user)
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
# Use www-data to run the first process
USER www-data
WORKDIR /www

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,535 @@
#!/bin/sh
export MC="-j$(nproc)"
echo
echo "============================================"
echo "Install extensions from : install.sh"
echo "PHP version : ${PHP_VERSION}"
echo "Extra Extensions : ${PHP_EXTENSIONS}"
echo "Multicore Compilation : ${MC}"
echo "Container package url : ${CONTAINER_PACKAGE_URL}"
echo "Work directory : ${PWD}"
echo "============================================"
echo
if [ "${PHP_EXTENSIONS}" != "" ]; then
apk add --no-cache autoconf g++ libtool make curl-dev gettext-dev linux-headers
fi
export EXTENSIONS=",${PHP_EXTENSIONS},"
#
# Check if current php version is greater than or equal to
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
# Return : 1 if greater than or equal to, 0 if less than
#
isPhpVersionGreaterOrEqual()
{
local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")
if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
return 1;
else
return 0;
fi
}
#
# Install extension from package file(.tgz),
# For example:
#
# installExtensionFromTgz redis-4.1.1
#
# Param 1: Package name with version
# Param 2: enable options
#
installExtensionFromTgz()
{
tgzName=$1
extensionName="${tgzName%%-*}"
mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable ${extensionName} $2
}
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
docker-php-ext-install ${MC} pdo_mysql
fi
if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then
echo "---------- Install pcntl ----------"
docker-php-ext-install ${MC} pcntl
fi
if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then
echo "---------- Install mysqli ----------"
docker-php-ext-install ${MC} mysqli
fi
if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then
echo "---------- mbstring is installed ----------"
fi
if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then
echo "---------- Install exif ----------"
docker-php-ext-install ${MC} exif
fi
if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then
echo "---------- Install bcmath ----------"
docker-php-ext-install ${MC} bcmath
fi
if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then
echo "---------- Install calendar ----------"
docker-php-ext-install ${MC} calendar
fi
if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then
echo "---------- Install zend_test ----------"
docker-php-ext-install ${MC} zend_test
fi
if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then
echo "---------- Install opcache ----------"
docker-php-ext-install opcache
fi
if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then
echo "---------- Install sockets ----------"
docker-php-ext-install ${MC} sockets
fi
if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then
echo "---------- Install gettext ----------"
docker-php-ext-install ${MC} gettext
fi
if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then
echo "---------- Install shmop ----------"
docker-php-ext-install ${MC} shmop
fi
if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then
echo "---------- Install sysvmsg ----------"
docker-php-ext-install ${MC} sysvmsg
fi
if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then
echo "---------- Install sysvsem ----------"
docker-php-ext-install ${MC} sysvsem
fi
if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then
echo "---------- Install sysvshm ----------"
docker-php-ext-install ${MC} sysvshm
fi
if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then
echo "---------- Install pdo_firebird ----------"
docker-php-ext-install ${MC} pdo_firebird
fi
if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then
echo "---------- Install pdo_dblib ----------"
docker-php-ext-install ${MC} pdo_dblib
fi
if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then
echo "---------- Install pdo_oci ----------"
docker-php-ext-install ${MC} pdo_oci
fi
if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then
echo "---------- Install pdo_odbc ----------"
docker-php-ext-install ${MC} pdo_odbc
fi
if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then
echo "---------- Install pdo_pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pdo_pgsql
fi
if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then
echo "---------- Install pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pgsql
fi
if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then
echo "---------- Install oci8 ----------"
docker-php-ext-install ${MC} oci8
fi
if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then
echo "---------- Install odbc ----------"
docker-php-ext-install ${MC} odbc
fi
if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then
echo "---------- Install dba ----------"
docker-php-ext-install ${MC} dba
fi
if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then
echo "---------- Install interbase ----------"
echo "Alpine linux do not support interbase/firebird!!!"
#docker-php-ext-install ${MC} interbase
fi
if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install ${MC} gd
fi
if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then
echo "---------- Install intl ----------"
apk add --no-cache icu-dev
docker-php-ext-install ${MC} intl
fi
if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then
echo "---------- Install bz2 ----------"
apk add --no-cache bzip2-dev
docker-php-ext-install ${MC} bz2
fi
if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then
echo "---------- Install soap ----------"
apk add --no-cache libxml2-dev
docker-php-ext-install ${MC} soap
fi
if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then
echo "---------- Install xsl ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} xsl
fi
if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then
echo "---------- Install xmlrpc ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} xmlrpc
fi
if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then
echo "---------- Install wddx ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} wddx
fi
if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then
echo "---------- curl is installed ----------"
fi
if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then
echo "---------- Install readline ----------"
apk add --no-cache readline-dev
apk add --no-cache libedit-dev
docker-php-ext-install ${MC} readline
fi
if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then
echo "---------- Install snmp ----------"
apk add --no-cache net-snmp-dev
docker-php-ext-install ${MC} snmp
fi
if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then
echo "---------- Install pspell ----------"
apk add --no-cache aspell-dev
apk add --no-cache aspell-en
docker-php-ext-install ${MC} pspell
fi
if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then
echo "---------- Install recode ----------"
apk add --no-cache recode-dev
docker-php-ext-install ${MC} recode
fi
if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then
echo "---------- Install tidy ----------"
apk add --no-cache tidyhtml-dev
# Fix: https://github.com/htacg/tidy-html5/issues/235
ln -s /usr/include/tidybuffio.h /usr/include/buffio.h
docker-php-ext-install ${MC} tidy
fi
if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then
echo "---------- Install gmp ----------"
apk add --no-cache gmp-dev
docker-php-ext-install ${MC} gmp
fi
if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then
echo "---------- Install imap ----------"
apk add --no-cache imap-dev
docker-php-ext-configure imap --with-imap --with-imap-ssl
docker-php-ext-install ${MC} imap
fi
if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then
echo "---------- Install ldap ----------"
apk add --no-cache ldb-dev
apk add --no-cache openldap-dev
docker-php-ext-install ${MC} ldap
fi
if [[ -z "${EXTENSIONS##*,yaml,*}" ]]; then
echo "---------- Install yaml ----------"
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaml
docker-php-ext-enable yaml
else
apk add --no-cache yaml-dev
installExtensionFromTgz yaml-2.0.0
fi
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
apk add --no-cache file-dev
apk add --no-cache imagemagick-dev
printf "\n" | pecl install imagick-3.4.4
docker-php-ext-enable imagick
fi
if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then
echo "---------- Install rar ----------"
printf "\n" | pecl install rar
docker-php-ext-enable rar
fi
if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then
echo "---------- Install ast ----------"
printf "\n" | pecl install ast
docker-php-ext-enable ast
fi
if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then
echo "---------- Install msgpack ----------"
printf "\n" | pecl install msgpack
docker-php-ext-enable msgpack
fi
if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then
echo "---------- Install igbinary ----------"
printf "\n" | pecl install igbinary
docker-php-ext-enable igbinary
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
fi
if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then
echo "---------- Install seaslog ----------"
printf "\n" | pecl install seaslog
docker-php-ext-enable seaslog
fi
if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
echo "---------- Install varnish ----------"
apk add --no-cache varnish
printf "\n" | pecl install varnish
docker-php-ext-enable varnish
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------"
else
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev \
&& docker-php-ext-install ${MC} mcrypt
fi
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
fi
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
apk add --no-cache libsodium-dev
docker-php-ext-install ${MC} sodium
fi
fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.9.4
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.0.2
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.6.1
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
echo "---------- Install event ----------"
apk add --no-cache libevent-dev
export is_sockets_installed=$(php -r "echo extension_loaded('sockets');")
if [[ "${is_sockets_installed}" = "" ]]; then
echo "---------- event is depend on sockets, install sockets first ----------"
docker-php-ext-install sockets
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.3 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
installExtensionFromTgz mongodb-1.5.5
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
mkdir cphalcon
tar -xf cphalcon-3.2.0.tgz -C cphalcon --strip-components=1
( cd cphalcon/build/php7/64bits && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable phalcon
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.4.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
echo "---------- Install zip ----------"
isPhpVersionGreaterOrEqual 7 3
# Fix: https://github.com/docker-library/php/issues/797
if [[ "$?" = "1" ]]; then
apk add --no-cache libzip-dev
docker-php-ext-configure zip --with-libzip=/usr/include
fi
docker-php-ext-install ${MC} zip
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
services/php70/hosts Normal file
View File

423
services/php70/php-fpm.conf Normal file
View File

@ -0,0 +1,423 @@
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or NONE) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = www-data
;group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1
; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool processes will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; process.priority = -19
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
; or group is differrent than the master process user. It allows to create process
; core dump and ptrace the process for the pool user.
; Default Value: no
; process.dumpable = yes
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 10
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in µs of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: /usr/local/share/php/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong
; The access log file
; Default: not set
;access.log = log/$pool.access.log
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: output header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/php/fpm7.slow.log
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 3
; Depth of slow log stack trace.
; Default Value: 20
;request_slowlog_trace_depth = 20
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
catch_workers_output = yes
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
;clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; execute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

1947
services/php70/php.ini Normal file

File diff suppressed because it is too large Load Diff

57
services/php71/Dockerfile Normal file
View File

@ -0,0 +1,57 @@
ARG PHP_VERSION
FROM ${PHP_VERSION}
ARG TZ
ARG PHP_EXTENSIONS
ARG CONTAINER_PACKAGE_URL
# RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories
# COPY ./extensions /tmp/extensions
# WORKDIR /tmp/extensions
# RUN chmod +x install.sh \
# && sh install.sh
# RUN rm -fr /tmp/extensions
RUN apk --no-cache add tzdata \
&& cp "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone
# Fix: https://github.com/docker-library/php/issues/240
RUN apk add gnu-libiconv --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/v3.10/community/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
RUN apk add --no-cache libzip-dev \
&& docker-php-ext-configure zip --with-libzip=/usr/include \
&& docker-php-ext-install zip
# Install composer and change it's cache home
# RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
# && chmod +x /usr/bin/composer
# RUN composer self-update --2.2
# WORKDIR /tmp
# RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
# && php composer-setup.php --version=2.2.18 \
# && mv composer.phar /usr/bin/composer \
# && php composer-setup.php --version=1.10.26 \
# && mv composer.phar /usr/bin/composer1 \
# && chmod +x /usr/bin/composer \
# && chmod +x /usr/bin/composer1 \
# && rm -f /tmp/composer-setup.php
# ENV COMPOSER_HOME=/tmp/composer-setup.php
ENV COMPOSER_HOME=/usr/local/bin/composer
# php image's www-data user uid & gid are 82, change them to 1000 (primary user)
RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data
# Use www-data to run the first process
USER www-data
WORKDIR /www

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,530 @@
#!/bin/sh
export MC="-j$(nproc)"
echo
echo "============================================"
echo "Install extensions from : install.sh"
echo "PHP version : ${PHP_VERSION}"
echo "Extra Extensions : ${PHP_EXTENSIONS}"
echo "Multicore Compilation : ${MC}"
echo "Container package url : ${CONTAINER_PACKAGE_URL}"
echo "Work directory : ${PWD}"
echo "============================================"
echo
if [ "${PHP_EXTENSIONS}" != "" ]; then
apk add --no-cache autoconf g++ libtool make curl-dev gettext-dev linux-headers
fi
export EXTENSIONS=",${PHP_EXTENSIONS},"
#
# Check if current php version is greater than or equal to
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
# Return : 1 if greater than or equal to, 0 if less than
#
isPhpVersionGreaterOrEqual()
{
local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")
if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
return 1;
else
return 0;
fi
}
#
# Install extension from package file(.tgz),
# For example:
#
# installExtensionFromTgz redis-4.1.1
#
# Param 1: Package name with version
# Param 2: enable options
#
installExtensionFromTgz()
{
tgzName=$1
extensionName="${tgzName%%-*}"
mkdir ${extensionName}
tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1
( cd ${extensionName} && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable ${extensionName} $2
}
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
docker-php-ext-install ${MC} pdo_mysql
fi
if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then
echo "---------- Install pcntl ----------"
docker-php-ext-install ${MC} pcntl
fi
if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then
echo "---------- Install mysqli ----------"
docker-php-ext-install ${MC} mysqli
fi
if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then
echo "---------- mbstring is installed ----------"
fi
if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then
echo "---------- Install exif ----------"
docker-php-ext-install ${MC} exif
fi
if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then
echo "---------- Install bcmath ----------"
docker-php-ext-install ${MC} bcmath
fi
if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then
echo "---------- Install calendar ----------"
docker-php-ext-install ${MC} calendar
fi
if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then
echo "---------- Install zend_test ----------"
docker-php-ext-install ${MC} zend_test
fi
if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then
echo "---------- Install opcache ----------"
docker-php-ext-install opcache
fi
if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then
echo "---------- Install sockets ----------"
docker-php-ext-install ${MC} sockets
fi
if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then
echo "---------- Install gettext ----------"
docker-php-ext-install ${MC} gettext
fi
if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then
echo "---------- Install shmop ----------"
docker-php-ext-install ${MC} shmop
fi
if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then
echo "---------- Install sysvmsg ----------"
docker-php-ext-install ${MC} sysvmsg
fi
if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then
echo "---------- Install sysvsem ----------"
docker-php-ext-install ${MC} sysvsem
fi
if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then
echo "---------- Install sysvshm ----------"
docker-php-ext-install ${MC} sysvshm
fi
if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then
echo "---------- Install pdo_firebird ----------"
docker-php-ext-install ${MC} pdo_firebird
fi
if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then
echo "---------- Install pdo_dblib ----------"
docker-php-ext-install ${MC} pdo_dblib
fi
if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then
echo "---------- Install pdo_oci ----------"
docker-php-ext-install ${MC} pdo_oci
fi
if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then
echo "---------- Install pdo_odbc ----------"
docker-php-ext-install ${MC} pdo_odbc
fi
if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then
echo "---------- Install pdo_pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pdo_pgsql
fi
if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then
echo "---------- Install pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pgsql
fi
if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then
echo "---------- Install oci8 ----------"
docker-php-ext-install ${MC} oci8
fi
if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then
echo "---------- Install odbc ----------"
docker-php-ext-install ${MC} odbc
fi
if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then
echo "---------- Install dba ----------"
docker-php-ext-install ${MC} dba
fi
if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then
echo "---------- Install interbase ----------"
echo "Alpine linux do not support interbase/firebird!!!"
#docker-php-ext-install ${MC} interbase
fi
if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install ${MC} gd
fi
if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then
echo "---------- Install intl ----------"
apk add --no-cache icu-dev
docker-php-ext-install ${MC} intl
fi
if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then
echo "---------- Install bz2 ----------"
apk add --no-cache bzip2-dev
docker-php-ext-install ${MC} bz2
fi
if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then
echo "---------- Install soap ----------"
apk add --no-cache libxml2-dev
docker-php-ext-install ${MC} soap
fi
if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then
echo "---------- Install xsl ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} xsl
fi
if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then
echo "---------- Install xmlrpc ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} xmlrpc
fi
if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then
echo "---------- Install wddx ----------"
apk add --no-cache libxml2-dev libxslt-dev
docker-php-ext-install ${MC} wddx
fi
if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then
echo "---------- curl is installed ----------"
fi
if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then
echo "---------- Install readline ----------"
apk add --no-cache readline-dev
apk add --no-cache libedit-dev
docker-php-ext-install ${MC} readline
fi
if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then
echo "---------- Install snmp ----------"
apk add --no-cache net-snmp-dev
docker-php-ext-install ${MC} snmp
fi
if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then
echo "---------- Install pspell ----------"
apk add --no-cache aspell-dev
apk add --no-cache aspell-en
docker-php-ext-install ${MC} pspell
fi
if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then
echo "---------- Install recode ----------"
apk add --no-cache recode-dev
docker-php-ext-install ${MC} recode
fi
if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then
echo "---------- Install tidy ----------"
apk add --no-cache tidyhtml-dev
# Fix: https://github.com/htacg/tidy-html5/issues/235
ln -s /usr/include/tidybuffio.h /usr/include/buffio.h
docker-php-ext-install ${MC} tidy
fi
if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then
echo "---------- Install gmp ----------"
apk add --no-cache gmp-dev
docker-php-ext-install ${MC} gmp
fi
if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then
echo "---------- Install imap ----------"
apk add --no-cache imap-dev
docker-php-ext-configure imap --with-imap --with-imap-ssl
docker-php-ext-install ${MC} imap
fi
if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then
echo "---------- Install ldap ----------"
apk add --no-cache ldb-dev
apk add --no-cache openldap-dev
docker-php-ext-install ${MC} ldap
fi
if [[ -z "${EXTENSIONS##*,yaml,*}" ]]; then
echo "---------- Install yaml ----------"
apk add --no-cache yaml-dev
printf "\n" | pecl install yaml
docker-php-ext-enable yaml
fi
if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then
echo "---------- Install imagick ----------"
apk add --no-cache file-dev
apk add --no-cache imagemagick-dev
printf "\n" | pecl install imagick-3.4.4
docker-php-ext-enable imagick
fi
if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then
echo "---------- Install rar ----------"
printf "\n" | pecl install rar
docker-php-ext-enable rar
fi
if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then
echo "---------- Install ast ----------"
printf "\n" | pecl install ast
docker-php-ext-enable ast
fi
if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then
echo "---------- Install msgpack ----------"
printf "\n" | pecl install msgpack
docker-php-ext-enable msgpack
fi
if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then
echo "---------- Install igbinary ----------"
printf "\n" | pecl install igbinary
docker-php-ext-enable igbinary
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
fi
if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then
echo "---------- Install seaslog ----------"
printf "\n" | pecl install seaslog
docker-php-ext-enable seaslog
fi
if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
echo "---------- Install varnish ----------"
apk add --no-cache varnish
printf "\n" | pecl install varnish
docker-php-ext-enable varnish
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install pdo_sqlsrv
docker-php-ext-enable pdo_sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
if [[ "$?" = "1" ]]; then
echo "---------- Install sqlsrv ----------"
apk add --no-cache unixodbc-dev
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi
if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------"
else
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev \
&& docker-php-ext-install ${MC} mcrypt
fi
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
fi
fi
if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
echo
echo "Sodium is bundled with PHP from PHP 7.2.0"
echo
else
echo "---------- Install sodium ----------"
apk add --no-cache libsodium-dev
docker-php-ext-install ${MC} sodium
fi
fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.9.4
fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz redis-5.0.2
fi
if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install redis ----------"
installExtensionFromTgz apcu-5.1.17
fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi
docker-php-ext-enable memcached
fi
if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.6.1
else
installExtensionFromTgz xdebug-2.5.5
fi
fi
if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
echo "---------- Install event ----------"
apk add --no-cache libevent-dev
export is_sockets_installed=$(php -r "echo extension_loaded('sockets');")
if [[ "${is_sockets_installed}" = "" ]]; then
echo "---------- event is depend on sockets, install sockets first ----------"
docker-php-ext-install sockets
fi
echo "---------- Install event again ----------"
installExtensionFromTgz event-2.5.3 "--ini-name event.ini"
fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
installExtensionFromTgz mongodb-1.5.5
fi
if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi
if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then
echo "---------- Install phalcon ----------"
mkdir cphalcon
tar -xf cphalcon-3.2.0.tgz -C cphalcon --strip-components=1
( cd cphalcon/build/php7/64bits && phpize && ./configure && make ${MC} && make install )
docker-php-ext-enable phalcon
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.4.2
else
installExtensionFromTgz swoole-2.0.11
fi
fi
if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
echo "---------- Install zip ----------"
isPhpVersionGreaterOrEqual 7 3
# Fix: https://github.com/docker-library/php/issues/797
if [[ "$?" = "1" ]]; then
apk add --no-cache libzip-dev
docker-php-ext-configure zip --with-libzip=/usr/include
fi
docker-php-ext-install ${MC} zip
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
services/php71/hosts Normal file
View File

423
services/php71/php-fpm.conf Normal file
View File

@ -0,0 +1,423 @@
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or NONE) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = www-data
;group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1
; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool processes will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; process.priority = -19
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
; or group is differrent than the master process user. It allows to create process
; core dump and ptrace the process for the pool user.
; Default Value: no
; process.dumpable = yes
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 10
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in µs of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: /usr/local/share/php/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong
; The access log file
; Default: not set
;access.log = log/$pool.access.log
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: output header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/php/fpm7.slow.log
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 3
; Depth of slow log stack trace.
; Default Value: 20
;request_slowlog_trace_depth = 20
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
catch_workers_output = yes
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
;clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; execute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

1947
services/php71/php.ini Normal file

File diff suppressed because it is too large Load Diff