├── .gitignore ├── LICENSE ├── README.md ├── data ├── composer │ └── .gitignore ├── mongo │ └── .gitignore ├── mysql │ └── .gitignore └── redis │ └── .gitignore ├── demo.md ├── demo └── go │ └── webService │ ├── go.mod │ ├── internal │ ├── client.go │ └── hub.go │ └── main.go ├── docker-compose.sample.yml ├── env.sample ├── godemo.md ├── golang ├── demo01 │ └── main.go ├── demo02 │ └── main.go ├── demo03 │ └── main.go └── go.mod ├── services ├── elasticsearch │ ├── Dockerfile │ ├── elasticsearch.yml │ ├── jvm.options │ └── log4j2.properties ├── mysql │ └── mysql.cnf ├── nginx │ ├── Dockerfile │ ├── conf.d │ │ ├── .gitignore │ │ └── localhost.conf │ ├── fastcgi-php.conf │ ├── fastcgi_params │ ├── nginx.conf │ └── ssl │ │ └── localhost │ │ ├── localhost.crt │ │ └── localhost.key ├── php56 │ ├── php-fpm.conf │ └── php.ini ├── php71 │ ├── Dockerfile │ ├── extensions │ │ ├── amqp-1.9.4.tgz │ │ ├── apcu-5.1.17.tgz │ │ ├── event-2.5.3.tgz │ │ ├── install.sh │ │ ├── memcache-2.2.6.tgz │ │ ├── memcache-4.0.5.2.tgz │ │ ├── mongodb-1.5.5.tgz │ │ ├── redis-5.0.2.tgz │ │ ├── swoole-2.0.11.tgz │ │ ├── swoole-4.4.2.tgz │ │ ├── xdebug-2.5.5.tgz │ │ ├── xdebug-2.6.1.tgz │ │ ├── xdebug-2.9.2.tgz │ │ ├── xhprof-2.1.0.tgz │ │ └── yaf-2.3.5.tgz │ ├── php-fpm.conf │ └── php.ini ├── php72 │ ├── Dockerfile │ ├── extensions │ │ ├── amqp-1.9.4.tgz │ │ ├── apcu-5.1.17.tgz │ │ ├── event-2.5.3.tgz │ │ ├── install.sh │ │ ├── memcache-2.2.6.tgz │ │ ├── memcache-4.0.5.2.tgz │ │ ├── mongodb-1.5.5.tgz │ │ ├── redis-5.0.2.tgz │ │ ├── swoole-2.0.11.tgz │ │ ├── swoole-4.4.2.tgz │ │ ├── xdebug-2.5.5.tgz │ │ ├── xdebug-2.6.1.tgz │ │ ├── xdebug-2.9.2.tgz │ │ ├── xhprof-2.1.0.tgz │ │ └── yaf-2.3.5.tgz │ ├── php-fpm.conf │ └── php.ini ├── php73 │ ├── Dockerfile │ ├── extensions │ │ ├── amqp-1.9.4.tgz │ │ ├── apcu-5.1.17.tgz │ │ ├── event-2.5.3.tgz │ │ ├── install.sh │ │ ├── memcache-2.2.6.tgz │ │ ├── memcache-4.0.5.2.tgz │ │ ├── mongodb-1.5.5.tgz │ │ ├── redis-5.0.2.tgz │ │ ├── swoole-2.0.11.tgz │ │ ├── swoole-4.4.2.tgz │ │ ├── xdebug-2.5.5.tgz │ │ ├── xdebug-2.6.1.tgz │ │ ├── xdebug-2.9.2.tgz │ │ ├── xhprof-2.1.0.tgz │ │ └── yaf-2.3.5.tgz │ ├── php-fpm.conf │ └── php.ini ├── php8 │ ├── Dockerfile │ ├── extensions │ │ ├── event-3.0.5.tgz │ │ ├── install-php-extensions │ │ └── install.sh │ ├── php-fpm.conf │ └── php.ini ├── phpmyadmin │ ├── config.inc.php │ └── php-phpmyadmin.ini ├── rabbitmq │ └── Dockerfile ├── redis │ └── redis.conf └── supervisor │ ├── Dockerfile │ ├── conf.d │ └── php-fpm.ini │ └── supervisord.conf └── www └── localhost └── index.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 siyecoo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ## 目录结构 6 | 7 | ``` 8 | / 9 | ├── data 数据库数据目录 10 | │   └── mysql MySQL5 数据目录 11 | ├── services 服务构建文件和配置文件目录 12 | │   ├── mysql MySQL 配置文件目录 13 | │   ├── nginx Nginx 配置文件目录 14 | │   ├── php8 PHP8 配置目录 15 | │   ├── php73 PHP73 配置目录 16 | │   ├── php72 PHP72 配置目录 17 | │   ├── php71 PHP71 配置目录 18 | │   ├── php56 PHP56 配置目录 19 | │   └── redis Redis 配置目录 20 | │   └── supervisor 进程管理工具 配置目录 21 | │   └── phpmyadmin phpmyadmin配置 22 | │   └── rabbitmq Rabbitmq 23 | │   └── elasticsearch elasticsearch全文搜索[可以自行安装插件,目前安装了pinyin,ik] 24 | ├── logs 日志目录 25 | ├── docker-compose.sample.yml Docker 服务配置示例文件 26 | ├── env.smaple 环境配置示例文件 27 | └── www PHP 代码目录 28 | ``` 29 | 30 | 31 | 32 | 1. 首先clone项目 https://github.com/siyecoo/docker-php.git 33 | 2. 如果当前不是root用户,需要先将用户加入**docker**用户组 sudo gpasswd -a ${USER} docker 34 | 3. 启动项目操作流程: 35 | ```` 36 | 1.cd docker-php 目录 37 | 2.cp env.sample .env docker-compose-sample.yml docker-compose.yml (需要配置一下环境变量,docker-compose.yml可以开启一些注释的PHP多版本,如果只想单纯版本直接复制一份即可) 38 | 3.docker-compose up -d 启动 (-d是后台执行,docker-compose up -d nginx redis php mysql 也可以这样执行,看你需要启动的镜像容器需要哪些 也可以单个) 39 | 40 | 4. 默认已经帮配置了localhost演示环境 `http://localhost`就能看到效果,代码在www目录下的localhost 41 | 42 | 43 | 然后重新build PHP镜像。 44 | ```bash 45 | docker-compose build php71 #php72 php73 php8 php56 php71 5个版本都可以 46 | ``` 47 | 可用的扩展请看同文件的`env.sample`注释块说明。 48 | 49 | 50 | ## 服务器启动和构建命令 51 | 如需管理服务,请在命令后面加上服务器名称,例如: 52 | ```bash 53 | $ docker-compose up # 创建并且启动所有容器 54 | $ docker-compose up -d # 创建并且后台运行方式启动所有容器 55 | $ docker-compose up nginx php mysql # 创建并且启动nginx、php、mysql的多个容器 56 | $ docker-compose up -d nginx php mysql # 创建并且已后台运行的方式启动nginx、php、mysql容器 57 | 58 | 59 | $ docker-compose start php # 启动服务 60 | $ docker-compose stop php # 停止服务 61 | $ docker-compose restart php # 重启服务 62 | $ docker-compose build php # 构建或者重新构建服务 63 | 64 | $ docker-compose rm php # 删除并且停止php容器 65 | $ docker-compose down # 停止并删除容器,网络,图像和挂载卷 66 | ``` 67 | 68 | 69 | -------------------------------------------------------------------------------- /data/composer/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /data/mongo/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /data/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /data/redis/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /demo.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ## Demo websocket简单的推送消息 6 | 7 | ``` 8 | / 9 | ├── go 10 | │   └── webService 11 | │      └── internal 代码目录 12 | │   └── main.go 入口文件 13 | 14 | ``` 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /demo/go/webService/go.mod: -------------------------------------------------------------------------------- 1 | module webService 2 | 3 | go 1.17 4 | 5 | require github.com/gorilla/websocket v1.5.0 6 | -------------------------------------------------------------------------------- /demo/go/webService/internal/client.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "log" 7 | "net/http" 8 | "time" 9 | 10 | "github.com/gorilla/websocket" 11 | ) 12 | 13 | const ( 14 | pongWait = 60 * time.Second 15 | bufSize = 256 16 | ) 17 | 18 | var upgrader = websocket.Upgrader{ 19 | ReadBufferSize: 1024, 20 | WriteBufferSize: 1024, 21 | } 22 | 23 | type Client struct { 24 | hub *Hub 25 | 26 | conn *websocket.Conn 27 | 28 | send chan []byte 29 | 30 | heartBeating chan string 31 | } 32 | 33 | type MsgInfo struct { 34 | Type string `json:"type"` 35 | Message string `json:"message"` 36 | } 37 | 38 | func (c *Client) heartBeatingMethod() { 39 | 40 | defer func() { 41 | c.conn.Close() 42 | }() 43 | 44 | for { 45 | select { 46 | case <-c.heartBeating: 47 | fmt.Println(fmt.Sprintf("当前时间[%s],客户端[%s]:心跳检测成功.", time.Now().String(), c.conn.RemoteAddr().String())) 48 | case <-time.After(pongWait): 49 | fmt.Println(fmt.Sprintf("当前时间[%s],客户端[%s]:超过心跳时间,退出结束.", time.Now().String(), c.conn.RemoteAddr().String())) 50 | return 51 | } 52 | } 53 | } 54 | 55 | func (c *Client) readPump() { 56 | defer func() { 57 | close(c.send) 58 | fmt.Println("结束readPump协程") 59 | }() 60 | for { 61 | _, message, err := c.conn.ReadMessage() 62 | 63 | if err != nil { 64 | fmt.Println(fmt.Sprintf("当前时间[%s],客户端[%s]:读取数据失败,ERROR[%s]", time.Now().String(), c.conn.RemoteAddr().String(), err)) 65 | return 66 | } 67 | 68 | var msgInfo MsgInfo 69 | 70 | if err := json.Unmarshal(message, &msgInfo); err != nil { 71 | fmt.Println(fmt.Sprintf("当前时间[%s],客户端[%s]:数据格式解析异常[%s]", time.Now().String(), c.conn.RemoteAddr().String(), err)) 72 | } 73 | 74 | switch msgInfo.Type { 75 | case "ping": 76 | fmt.Println(fmt.Sprintf("当前时间[%s],客户端[%s]:客户端发送心跳包[%s]", time.Now().String(), c.conn.RemoteAddr().String(), string(message))) 77 | c.heartBeating <- msgInfo.Message 78 | case "broadcast": 79 | if msgInfo.Message == "S5jqlCFsHAErBTKO" { 80 | c.hub.broadcast <- msgInfo.Message 81 | } 82 | } 83 | } 84 | } 85 | 86 | func (c *Client) writePump() { 87 | 88 | defer func() { 89 | c.hub.unregister <- c 90 | fmt.Println("结束writePump协程") 91 | }() 92 | 93 | for { 94 | select { 95 | case message, ok := <-c.send: 96 | fmt.Println(fmt.Sprintf("当前时间[%s],客户端[%s]:后台推送广播数据到该客户端,推送内容[%s]", time.Now().String(), c.conn.RemoteAddr().String(), string(message))) 97 | if !ok { 98 | return 99 | } 100 | c.conn.WriteMessage(websocket.TextMessage, message) 101 | } 102 | } 103 | } 104 | 105 | // ServeWs handles websocket requests from the peer. 106 | func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request) { 107 | 108 | upgrader.CheckOrigin = func(r *http.Request) bool { 109 | return true 110 | } 111 | 112 | conn, err := upgrader.Upgrade(w, r, nil) 113 | if err != nil { 114 | log.Println(err) 115 | return 116 | } 117 | 118 | client := &Client{ 119 | hub: hub, 120 | conn: conn, 121 | send: make(chan []byte, bufSize), 122 | heartBeating: make(chan string, bufSize), 123 | } 124 | client.hub.register <- client 125 | 126 | go client.readPump() 127 | go client.writePump() 128 | client.heartBeatingMethod() 129 | 130 | } 131 | -------------------------------------------------------------------------------- /demo/go/webService/internal/hub.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // Hub maintains the set of active clients and broadcasts messages to the 4 | // clients. 5 | type Hub struct { 6 | // Registered clients. 7 | clients map[*Client]bool 8 | 9 | // Inbound messages from the clients. 10 | broadcast chan string 11 | 12 | // Register requests from the clients. 13 | register chan *Client 14 | 15 | // Unregister requests from clients. 16 | unregister chan *Client 17 | } 18 | 19 | func NewHub() *Hub { 20 | return &Hub{ 21 | broadcast: make(chan string), 22 | register: make(chan *Client), 23 | unregister: make(chan *Client), 24 | clients: make(map[*Client]bool), 25 | } 26 | } 27 | 28 | func (h *Hub) Run() { 29 | for { 30 | select { 31 | case client := <-h.register: 32 | h.clients[client] = true 33 | case client := <-h.unregister: 34 | if _, ok := h.clients[client]; ok { 35 | delete(h.clients, client) 36 | } 37 | case <-h.broadcast: 38 | for client := range h.clients { 39 | select { 40 | case client.send <- []byte(`{"open":1}`): 41 | default: 42 | close(client.send) 43 | delete(h.clients, client) 44 | } 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo/go/webService/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | "webService/internal" 7 | ) 8 | 9 | func main() { 10 | hub := internal.NewHub() 11 | go hub.Run() 12 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 13 | internal.ServeWs(hub, w, r) 14 | }) 15 | err := http.ListenAndServe(":8087", nil) 16 | if err != nil { 17 | log.Fatal("ListenAndServe: ", err) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docker-compose.sample.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | nginx: 4 | build: 5 | context: ./services/nginx 6 | args: 7 | NGINX_VERSION: nginx:${NGINX_VERSION} 8 | CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} 9 | NGINX_INSTALL_APPS: ${NGINX_INSTALL_APPS} 10 | container_name: nginx 11 | ports: 12 | - "${NGINX_HTTP_HOST_PORT}:80" 13 | - "${NGINX_HTTPS_HOST_PORT}:443" 14 | volumes: 15 | - ${SOURCE_DIR}:/www/:rw 16 | - ${NGINX_SSL_CERTIFICATE_DIR}:/ssl:rw 17 | - ${NGINX_CONFD_DIR}:/etc/nginx/conf.d/:rw 18 | - ${NGINX_CONF_FILE}:/etc/nginx/nginx.conf:ro 19 | - ${NGINX_FASTCGI_PHP_CONF}:/etc/nginx/fastcgi-php.conf:ro 20 | - ${NGINX_FASTCGI_PARAMS}:/etc/nginx/fastcgi_params:ro 21 | - ${NGINX_LOG_DIR}:/var/log/nginx/:rw 22 | environment: 23 | TZ: "$TZ" 24 | restart: always 25 | networks: 26 | - default 27 | php8: 28 | build: 29 | context: ./services/php8 30 | args: 31 | PHP_VERSION: php:${PHP8_VERSION}-fpm 32 | CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} 33 | PHP_EXTENSIONS: ${PHP8_EXTENSIONS} 34 | TZ: "$TZ" 35 | container_name: php8 36 | volumes: 37 | - ${SOURCE_DIR}:/www/:rw 38 | - ${PHP8_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 39 | - ${PHP8_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 40 | - ${PHP8_LOG_DIR}:/var/log/php 41 | - ${DATA_DIR}/composer:/tmp/composer 42 | restart: always 43 | cap_add: 44 | - SYS_PTRACE 45 | networks: 46 | - default 47 | 48 | php73: 49 | build: 50 | context: ./services/php73 51 | args: 52 | PHP_VERSION: php:${PHP73_VERSION}-fpm-alpine 53 | CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} 54 | PHP_EXTENSIONS: ${PHP73_VERSION} 55 | TZ: "$TZ" 56 | container_name: php73 57 | volumes: 58 | - ${SOURCE_DIR}:/www/:cached 59 | - ${PHP73_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 60 | - ${PHP73_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 61 | - ${PHP73_LOG_DIR}:/var/log/php 62 | - ${DATA_DIR}/composer:/tmp/composer 63 | restart: always 64 | cap_add: 65 | - SYS_PTRACE 66 | networks: 67 | - default 68 | 69 | php72: 70 | build: 71 | context: ./services/php72 72 | args: 73 | PHP_VERSION: php:${PHP72_VERSION}-fpm-alpine 74 | CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} 75 | PHP_EXTENSIONS: ${PHP72_VERSION} 76 | TZ: "$TZ" 77 | container_name: php72 78 | volumes: 79 | - ${SOURCE_DIR}:/www/:cached 80 | - ${PHP72_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 81 | - ${PHP72_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 82 | - ${PHP72_LOG_DIR}:/var/log/php 83 | - ${DATA_DIR}/composer:/tmp/composer 84 | restart: always 85 | cap_add: 86 | - SYS_PTRACE 87 | networks: 88 | - default 89 | 90 | php71: 91 | build: 92 | context: ./services/php71 93 | args: 94 | PHP_VERSION: php:${PHP71_VERSION}-fpm-alpine 95 | CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} 96 | PHP_EXTENSIONS: ${PHP71_EXTENSIONS} 97 | TZ: "$TZ" 98 | container_name: php71 99 | volumes: 100 | - ${SOURCE_DIR}:/www/:rw 101 | - ${PHP71_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 102 | - ${PHP71_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 103 | - ${PHP71_LOG_DIR}:/var/log/php 104 | - ${DATA_DIR}/composer:/tmp/composer 105 | restart: always 106 | cap_add: 107 | - SYS_PTRACE 108 | networks: 109 | - default 110 | php56: 111 | build: 112 | context: ./services/php56 113 | args: 114 | PHP_VERSION: php:${PHP56_VERSION}-fpm-alpine 115 | CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} 116 | PHP_EXTENSIONS: ${PHP56_EXTENSIONS} 117 | TZ: "$TZ" 118 | container_name: php56 119 | expose: 120 | - 9501 121 | volumes: 122 | - ${SOURCE_DIR}:/www/:rw 123 | - ${PHP56_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 124 | - ${PHP56_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 125 | - ${PHP56_LOG_DIR}:/var/log/php 126 | - ${DATA_DIR}/composer:/tmp/composer 127 | restart: always 128 | cap_add: 129 | - SYS_PTRACE 130 | networks: 131 | - default 132 | 133 | mysql: 134 | image: mysql:${MYSQL_VERSION} 135 | container_name: mysql 136 | ports: 137 | - "${MYSQL_HOST_PORT}:3306" 138 | volumes: 139 | - ${MYSQL_CONF_FILE}:/etc/mysql/conf.d/mysql.cnf:ro 140 | - ${DATA_DIR}/mysql:/var/lib/mysql/:rw 141 | restart: always 142 | networks: 143 | - default 144 | environment: 145 | MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" 146 | TZ: "$TZ" 147 | 148 | 149 | phpmyadmin: 150 | image: phpmyadmin/phpmyadmin:latest 151 | container_name: phpmyadmin 152 | ports: 153 | - "${PHPMYADMIN_HOST_PORT}:80" 154 | volumes: 155 | - ${PHPMYADMIN_USER_CONF_FILE}:/etc/phpmyadmin/config.inc.php:ro 156 | - ${PHPMYADMIN_PHP_CONF_FILE}:/usr/local/etc/php/conf.d/php-phpmyadmin.ini:ro 157 | networks: 158 | - default 159 | environment: 160 | - PMA_HOST=mysql 161 | - PMA_PORT=3306 162 | - TZ=$TZ 163 | 164 | redis: 165 | image: redis:${REDIS_VERSION} 166 | container_name: redis 167 | ports: 168 | - "${REDIS_HOST_PORT}:6379" 169 | volumes: 170 | - ${REDIS_CONF_FILE}:/etc/redis.conf:ro 171 | - ${DATA_DIR}/redis:/data/:rw 172 | restart: always 173 | entrypoint: ["redis-server", "/etc/redis.conf"] 174 | environment: 175 | TZ: "$TZ" 176 | networks: 177 | - default 178 | 179 | memcached: 180 | image: memcached:${MEMCACHED_VERSION} 181 | container_name: memcached 182 | ports: 183 | - "${MEMCACHED_HOST_PORT}:11211" 184 | environment: 185 | MEMCACHED_CACHE_SIZE: "${MEMCACHED_CACHE_SIZE}" 186 | networks: 187 | - default 188 | 189 | mongodb: 190 | image: mongo:${MONGODB_VERSION} 191 | container_name: mongodb 192 | environment: 193 | MONGO_INITDB_ROOT_USERNAME: "${MONGODB_INITDB_ROOT_USERNAME}" 194 | MONGO_INITDB_ROOT_PASSWORD: "${MONGODB_INITDB_ROOT_PASSWORD}" 195 | TZ: "$TZ" 196 | volumes: 197 | - ${DATA_DIR}/mongo:/data/db:rw 198 | - ${DATA_DIR}/mongo_key:/mongo:rw 199 | ports: 200 | - "${MONGODB_HOST_PORT}:27017" 201 | networks: 202 | - default 203 | command: 204 | --auth 205 | 206 | rabbitmq: 207 | build: 208 | context: ./services/rabbitmq 209 | args: 210 | RABBITMQ_VERSION: ${RABBITMQ_VERSION} 211 | RABBITMQ_PLUGINS: ${RABBITMQ_PLUGINS} 212 | container_name: rabbitmq 213 | restart: always 214 | ports: 215 | - "${RABBITMQ_HOST_PORT_C}:5672" 216 | - "${RABBITMQ_HOST_PORT_S}:15672" 217 | environment: 218 | TZ: "$TZ" 219 | RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}" 220 | RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}" 221 | networks: 222 | - default 223 | 224 | elasticsearch: 225 | build: 226 | context: ./services/elasticsearch 227 | args: 228 | ELASTICSEARCH_VERSION: ${ELASTICSEARCH_VERSION} 229 | container_name: elasticsearch 230 | environment: 231 | - TZ=$TZ 232 | - discovery.type=single-node 233 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m" 234 | volumes: 235 | - ${DATA_DIR}/esdata:/usr/share/elasticsearch/data 236 | - ${ELASTICSEARCH_CONF_FILE}:/usr/share/elasticsearch/config/elasticsearch.yml 237 | hostname: elasticsearch 238 | restart: always 239 | ports: 240 | - "${ELASTICSEARCH_HOST_PORT_C}:9200" 241 | - "${ELASTICSEARCH_HOST_PORT_S}:9300" 242 | 243 | networks: 244 | default: 245 | -------------------------------------------------------------------------------- /env.sample: -------------------------------------------------------------------------------- 1 | # 2 | # PHP source directory 3 | # 4 | SOURCE_DIR=./www 5 | 6 | # 7 | # Runtime data directory 8 | # 9 | DATA_DIR=./data 10 | 11 | # 12 | # Container Timezone 13 | # 14 | TZ=Asia/Shanghai 15 | 16 | # 17 | # Container package fetch url 18 | # 19 | # Can be empty, followings or others: 20 | # mirrors.163.com 21 | # mirrors.aliyun.com 22 | # mirrors.ustc.edu.cn 23 | # 24 | CONTAINER_PACKAGE_URL=mirrors.aliyun.com 25 | 26 | # 27 | # Nginx 28 | # 29 | NGINX_VERSION=1.15.7-alpine 30 | NGINX_HTTP_HOST_PORT=80 31 | NGINX_HTTPS_HOST_PORT=443 32 | NGINX_CONFD_DIR=./services/nginx/conf.d 33 | NGINX_CONF_FILE=./services/nginx/nginx.conf 34 | NGINX_FASTCGI_PHP_CONF=./services/nginx/fastcgi-php.conf 35 | NGINX_FASTCGI_PARAMS=./services/nginx/fastcgi_params 36 | NGINX_SSL_CERTIFICATE_DIR=./services/nginx/ssl 37 | NGINX_LOG_DIR=./logs/nginx 38 | # Available apps: certbot 39 | NGINX_INSTALL_APPS= 40 | 41 | # 42 | # PHP7-8 43 | # 44 | # Available PHP_EXTENSIONS: 45 | # 46 | # pdo_mysql,zip,pcntl,mysqli,mbstring,exif,bcmath,calendar, 47 | # sockets,gettext,shmop,sysvmsg,sysvsem,sysvshm,pdo_rebird, 48 | # pdo_dblib,pdo_oci,pdo_odbc,pdo_pgsql,pgsql,oci8,odbc,dba, 49 | # gd,soap,xsl,curl,readline,mcrypt,opcache, 50 | # redis,memcached,xdebug,swoole,pdo_sqlsrv,yaf,mysql, 51 | # ,xlswriter,memcache 52 | # 53 | # You can let it empty to avoid installing any extensions, 54 | # or install multi plugins as: 55 | # PHP_EXTENSIONS=pdo_mysql,mysqli,gd,curl,opcache 56 | # 57 | 58 | 59 | 60 | PHP8_VERSION=8.0.18 61 | PHP8_PHP_CONF_FILE=./services/php8/php.ini 62 | PHP8_FPM_CONF_FILE=./services/php8/php-fpm.conf 63 | PHP8_LOG_DIR=./logs/php8 64 | PHP8_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,redis,xdebug,zip,openssl,sockets,xlswriter 65 | 66 | 67 | PHP73_VERSION=7.3.16 68 | PHP73_HOST_PORT=9501 69 | PHP73_PHP_CONF_FILE=./services/php73/php.ini 70 | PHP73_FPM_CONF_FILE=./services/php73/php-fpm.conf 71 | PHP73_LOG_DIR=./logs/php73 72 | PHP73_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,redis,swoole 73 | 74 | PHP72_VERSION=7.2.5 75 | PHP72_PHP_CONF_FILE=./services/php72/php.ini 76 | PHP72_FPM_CONF_FILE=./services/php72/php-fpm.conf 77 | PHP72_LOG_DIR=./logs/php72 78 | PHP72_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,redis,xdebug,zip,openssl,sockets,xlswriter 79 | 80 | 81 | PHP71_VERSION=7.1.33 82 | PHP71_HOST_PORT=9501 83 | PHP71_PHP_CONF_FILE=./services/php71/php.ini 84 | PHP71_FPM_CONF_FILE=./services/php71/php-fpm.conf 85 | PHP71_LOG_DIR=./logs/php71 86 | PHP71_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,redis,xdebug 87 | 88 | 89 | PHP56_VERSION=5.6.40 90 | PHP56_PHP_CONF_FILE=./services/php56/php.ini 91 | PHP56_FPM_CONF_FILE=./services/php56/php-fpm.conf 92 | PHP56_LOG_DIR=./logs/php 93 | PHP56_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache 94 | 95 | 96 | 97 | 98 | # 99 | # MySQL5 100 | # 101 | MYSQL5_VERSION=5.7.28 102 | MYSQL5_HOST_PORT=3305 103 | MYSQL5_ROOT_PASSWORD=123456 104 | MYSQL5_CONF_FILE=./services/mysql5/mysql.cnf 105 | 106 | # 107 | # Redis 108 | # 109 | REDIS_VERSION=5.0.3-alpine 110 | REDIS_HOST_PORT=6379 111 | REDIS_CONF_FILE=./services/redis/redis.conf 112 | 113 | 114 | # 115 | # MONGODB 116 | # 117 | MONGODB_VERSION=4.1 118 | MONGODB_HOST_PORT=27017 119 | MONGODB_INITDB_ROOT_USERNAME=root 120 | MONGODB_INITDB_ROOT_PASSWORD=123456 121 | 122 | 123 | 124 | # 125 | # MYSQL-MANAGE 126 | # 127 | 128 | 129 | MYSQL_MANAGE_VERSION=fpm-alpine 130 | MYSQL_MANAGE_USERNAME=admin 131 | MYSQL_MANAGE_PASSWORD=123456 132 | MYSQL_MANAGE_ROOT_PASSWORD=123456 133 | MYSQL_MANAGE_CONNECT_HOST=mysql 134 | MYSQL_MANAGE_CONNECT_PORT=3306 135 | MYSQL_MANAGE_PORT=1000 136 | 137 | 138 | 139 | # 140 | # Memcached 141 | # 142 | MEMCACHED_VERSION=alpine3.16 143 | MEMCACHED_HOST_PORT=11211 144 | MEMCACHED_CACHE_SIZE=128 145 | 146 | # 147 | # SUPERVISOR 148 | # 149 | SUPERVISOR_CONFIG=./services/supervisor/conf.d/ 150 | SUPERVISOR_LOG=./logs/supervisor 151 | SUPERVISOR_CONF_FILE=./services/supervisor/supervisord.conf 152 | SUPERVISOR_HOST_PORT_C=9001 153 | 154 | 155 | 156 | PHPMYADMIN_HOST_PORT=8087 157 | PHPMYADMIN_USER_CONF_FILE=./services/phpmyadmin/config.inc.php 158 | PHPMYADMIN_PHP_CONF_FILE=./services/phpmyadmin/php-phpmyadmin.ini 159 | 160 | 161 | # 162 | # RABBITMQ 163 | # 164 | 165 | RABBITMQ_VERSION=management 166 | RABBITMQ_CONF_FILE=./services/rabbitmq/rabbitmq.yml 167 | RABBITMQ_HOST_PORT_C=5672 168 | RABBITMQ_HOST_PORT_S=15672 169 | RABBITMQ_DEFAULT_USER=siyecoo 170 | RABBITMQ_DEFAULT_PASS=123456 171 | RABBITMQ_PLUGINS=rabbitmq_amqp1_0 172 | 173 | 174 | 175 | # 176 | # ELASTICSEARCH 177 | # 178 | 179 | 180 | ELASTICSEARCH_VERSION=7.17.9 181 | ELASTICSEARCH_CONF_FILE=./services/elasticsearch/elasticsearch.yml 182 | ELASTICSEARCH_HOST_PORT_C=9200 183 | ELASTICSEARCH_HOST_PORT_S=9300 -------------------------------------------------------------------------------- /godemo.md: -------------------------------------------------------------------------------- 1 | ## DEMO GOLANG 2 | 3 | 4 | ```` 5 | golang 目录下 6 | 1.demo01 创建数组的多种方式 7 | 2.demo02 创建map的多种方式 8 | 3.demo03 创建struct的方式和使用结构体方法注意的地方 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /golang/demo01/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | 7 | /** 8 | 定义数组联众方式 9 | */ 10 | 11 | //arr 名称 [长度]数据类型 12 | 13 | var arr [3]int 14 | 15 | arr[0] = 1 16 | arr[1] = 2 17 | arr[2] = 3 18 | 19 | fmt.Println(arr) 20 | 21 | // 数组定义并初始化 下面示例等同于 var arr2 [3]int = [3]int{1,2,3} 22 | 23 | arr2 := [3]int{1, 2, 3} 24 | 25 | fmt.Println(arr2) 26 | 27 | // 数组定义并初始化 下面示例等同于 var arr2 [3]int = [...]int{1,2,3} 前面 [3]int的中括号里的数字取决于你后面大括号{}定义的数量 28 | 29 | arr3 := [...]int{1, 0} 30 | 31 | fmt.Printf("%T", arr3) 32 | } 33 | -------------------------------------------------------------------------------- /golang/demo02/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | 7 | /** 8 | 9 | 创建map的多种方法 map创建需要主要需要定义 不然是会报错的 10 | 11 | 12 | */ 13 | 14 | /** 15 | 这种方式是最鸡肋的 16 | */ 17 | var mp map[string]int 18 | 19 | mp = map[string]int{"hello": 1, "go": 1} 20 | 21 | fmt.Println(mp) 22 | 23 | var mp2 = map[string]int{"hello": 1, "go": 2} 24 | 25 | fmt.Println(mp2) 26 | 27 | /** 28 | 这种是最常用的定义方式 也比较通俗易懂 29 | */ 30 | mp3 := make(map[string]int) 31 | 32 | mp3["hello"] = 1 33 | 34 | fmt.Println(mp3) 35 | 36 | } 37 | -------------------------------------------------------------------------------- /golang/demo03/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | type Person struct { 6 | Name string 7 | Age int 8 | } 9 | 10 | func (that Person) ChangeAge1(age int) { 11 | that.Age = age 12 | } 13 | 14 | func (that *Person) ChangeAge2(age int) { 15 | that.Age = age 16 | } 17 | 18 | func main() { 19 | 20 | /** 21 | 22 | 结构体的使用 23 | 24 | */ 25 | 26 | // 有指定名称的定义 27 | p := Person{Name: "Siyecoo", Age: 18} 28 | 29 | fmt.Println("p的值:", p) 30 | 31 | // 不指定名称 32 | 33 | p1 := Person{"hello", 20} 34 | 35 | fmt.Println("p1的值:", p1) 36 | 37 | //部分指定 38 | 39 | p2 := Person{Age: 15} 40 | fmt.Println("p2的值:", p2) 41 | 42 | //调用方法未指定结构体指针的情况下无法更改结构的属性 43 | 44 | p3 := Person{Age: 16} 45 | 46 | p3.ChangeAge1(20) 47 | 48 | fmt.Println("p3未改变Age的值:", p3) 49 | 50 | fmt.Println(p3) 51 | 52 | p3.ChangeAge2(15) 53 | fmt.Println("p3改变Age的值:", p3) 54 | 55 | } 56 | -------------------------------------------------------------------------------- /golang/go.mod: -------------------------------------------------------------------------------- 1 | module go_demo 2 | 3 | go 1.20 4 | -------------------------------------------------------------------------------- /services/elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ELASTICSEARCH_VERSION 2 | FROM elasticsearch:${ELASTICSEARCH_VERSION} 3 | 4 | ARG ELASTICSEARCH_VERSION 5 | 6 | elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v${ELASTICSEARCH_VERSION}/elasticsearch-analysis-ik-${ELASTICSEARCH_VERSION}.zip; 7 | elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v${ELASTICSEARCH_VERSION}/elasticsearch-analysis-pinyin-${ELASTICSEARCH_VERSION}.zip; 8 | 9 | -------------------------------------------------------------------------------- /services/elasticsearch/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | cluster.name: "docker-cluster" 2 | network.host: 0.0.0.0 3 | 4 | 5 | discovery.zen.minimum_master_nodes: 1 -------------------------------------------------------------------------------- /services/elasticsearch/jvm.options: -------------------------------------------------------------------------------- 1 | ## JVM configuration 2 | 3 | ################################################################ 4 | ## IMPORTANT: JVM heap size 5 | ################################################################ 6 | ## 7 | ## You should always set the min and max JVM heap 8 | ## size to the same value. For example, to set 9 | ## the heap to 4 GB, set: 10 | ## 11 | ## -Xms4g 12 | ## -Xmx4g 13 | ## 14 | ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html 15 | ## for more information 16 | ## 17 | ################################################################ 18 | 19 | # Xms represents the initial size of total heap space 20 | # Xmx represents the maximum size of total heap space 21 | 22 | -Xms1g 23 | -Xmx1g 24 | 25 | ################################################################ 26 | ## Expert settings 27 | ################################################################ 28 | ## 29 | ## All settings below this section are considered 30 | ## expert settings. Don't tamper with them unless 31 | ## you understand what you are doing 32 | ## 33 | ################################################################ 34 | 35 | ## GC configuration 36 | -XX:+UseConcMarkSweepGC 37 | -XX:CMSInitiatingOccupancyFraction=75 38 | -XX:+UseCMSInitiatingOccupancyOnly 39 | 40 | ## G1GC Configuration 41 | # NOTE: G1GC is only supported on JDK version 10 or later. 42 | # To use G1GC uncomment the lines below. 43 | # 10-:-XX:-UseConcMarkSweepGC 44 | # 10-:-XX:-UseCMSInitiatingOccupancyOnly 45 | # 10-:-XX:+UseG1GC 46 | # 10-:-XX:InitiatingHeapOccupancyPercent=75 47 | 48 | ## DNS cache policy 49 | # cache ttl in seconds for positive DNS lookups noting that this overrides the 50 | # JDK security property networkaddress.cache.ttl; set to -1 to cache forever 51 | -Des.networkaddress.cache.ttl=60 52 | # cache ttl in seconds for negative DNS lookups noting that this overrides the 53 | # JDK security property networkaddress.cache.negative ttl; set to -1 to cache 54 | # forever 55 | -Des.networkaddress.cache.negative.ttl=10 56 | 57 | ## optimizations 58 | 59 | # pre-touch memory pages used by the JVM during initialization 60 | -XX:+AlwaysPreTouch 61 | 62 | ## basic 63 | 64 | # explicitly set the stack size 65 | -Xss1m 66 | 67 | # set to headless, just in case 68 | -Djava.awt.headless=true 69 | 70 | # ensure UTF-8 encoding by default (e.g. filenames) 71 | -Dfile.encoding=UTF-8 72 | 73 | # use our provided JNA always versus the system one 74 | -Djna.nosys=true 75 | 76 | # turn off a JDK optimization that throws away stack traces for common 77 | # exceptions because stack traces are important for debugging 78 | -XX:-OmitStackTraceInFastThrow 79 | 80 | # flags to configure Netty 81 | -Dio.netty.noUnsafe=true 82 | -Dio.netty.noKeySetOptimization=true 83 | -Dio.netty.recycler.maxCapacityPerThread=0 84 | 85 | # log4j 2 86 | -Dlog4j.shutdownHookEnabled=false 87 | -Dlog4j2.disable.jmx=true 88 | 89 | -Djava.io.tmpdir=${ES_TMPDIR} 90 | 91 | ## heap dumps 92 | 93 | # generate a heap dump when an allocation from the Java heap fails 94 | # heap dumps are created in the working directory of the JVM 95 | -XX:+HeapDumpOnOutOfMemoryError 96 | 97 | # specify an alternative path for heap dumps; ensure the directory exists and 98 | # has sufficient space 99 | -XX:HeapDumpPath=data 100 | 101 | # specify an alternative path for JVM fatal error logs 102 | -XX:ErrorFile=logs/hs_err_pid%p.log 103 | 104 | ## JDK 8 GC logging 105 | 106 | 8:-XX:+PrintGCDetails 107 | 8:-XX:+PrintGCDateStamps 108 | 8:-XX:+PrintTenuringDistribution 109 | 8:-XX:+PrintGCApplicationStoppedTime 110 | 8:-Xloggc:logs/gc.log 111 | 8:-XX:+UseGCLogFileRotation 112 | 8:-XX:NumberOfGCLogFiles=32 113 | 8:-XX:GCLogFileSize=64m 114 | 115 | # JDK 9+ GC logging 116 | 9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m 117 | # due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise 118 | # time/date parsing will break in an incompatible way for some date patterns and locals 119 | 9-:-Djava.locale.providers=COMPAT 120 | -------------------------------------------------------------------------------- /services/elasticsearch/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | # log action execution errors for easier debugging 4 | logger.action.name = org.elasticsearch.action 5 | logger.action.level = debug 6 | 7 | appender.rolling.type = Console 8 | appender.rolling.name = rolling 9 | appender.rolling.layout.type = ESJsonLayout 10 | appender.rolling.layout.type_name = server 11 | 12 | rootLogger.level = info 13 | rootLogger.appenderRef.rolling.ref = rolling 14 | 15 | appender.deprecation_rolling.type = Console 16 | appender.deprecation_rolling.name = deprecation_rolling 17 | appender.deprecation_rolling.layout.type = ESJsonLayout 18 | appender.deprecation_rolling.layout.type_name = deprecation 19 | 20 | logger.deprecation.name = org.elasticsearch.deprecation 21 | logger.deprecation.level = warn 22 | logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling 23 | logger.deprecation.additivity = false 24 | 25 | appender.index_search_slowlog_rolling.type = Console 26 | appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling 27 | appender.index_search_slowlog_rolling.layout.type = ESJsonLayout 28 | appender.index_search_slowlog_rolling.layout.type_name = index_search_slowlog 29 | 30 | logger.index_search_slowlog_rolling.name = index.search.slowlog 31 | logger.index_search_slowlog_rolling.level = trace 32 | logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = index_search_slowlog_rolling 33 | logger.index_search_slowlog_rolling.additivity = false 34 | 35 | appender.index_indexing_slowlog_rolling.type = Console 36 | appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling 37 | appender.index_indexing_slowlog_rolling.layout.type = ESJsonLayout 38 | appender.index_indexing_slowlog_rolling.layout.type_name = index_indexing_slowlog 39 | 40 | logger.index_indexing_slowlog.name = index.indexing.slowlog.index 41 | logger.index_indexing_slowlog.level = trace 42 | logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = index_indexing_slowlog_rolling 43 | logger.index_indexing_slowlog.additivity = false 44 | -------------------------------------------------------------------------------- /services/mysql/mysql.cnf: -------------------------------------------------------------------------------- 1 | [client] 2 | port = 3306 3 | default-character-set = utf8mb4 4 | 5 | 6 | [mysqld] 7 | user = mysql 8 | port = 3306 9 | sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 10 | 11 | default-storage-engine = InnoDB 12 | default-authentication-plugin = mysql_native_password 13 | character-set-server = utf8mb4 14 | collation-server = utf8mb4_unicode_ci 15 | init_connect = 'SET NAMES utf8mb4' 16 | 17 | disable-log-bin 18 | skip-character-set-client-handshake 19 | explicit_defaults_for_timestamp 20 | 21 | slow_query_log 22 | long_query_time = 3 23 | slow-query-log-file = /var/lib/mysql/mysql.slow.log 24 | log-error = /var/lib/mysql/mysql.error.log 25 | 26 | default-time-zone = '+8:00' 27 | 28 | [mysql] 29 | default-character-set = utf8mb4 30 | -------------------------------------------------------------------------------- /services/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG NGINX_VERSION 2 | FROM nginx:${NGINX_VERSION} 3 | 4 | ARG TZ 5 | ARG NGINX_VERSION 6 | ARG CONTAINER_PACKAGE_URL 7 | ARG NGINX_INSTALL_APPS 8 | 9 | ENV INSTALL_APPS=",${NGINX_INSTALL_APPS}," 10 | 11 | RUN if [ "${CONTAINER_PACKAGE_URL}" != "" ]; then \ 12 | sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories; \ 13 | fi 14 | 15 | RUN if [ -z "${INSTALL_APPS##*,certbot,*}" ]; then \ 16 | echo "---------- Install certbot ----------"; \ 17 | apk add --no-cache certbot; \ 18 | fi 19 | 20 | WORKDIR /www 21 | -------------------------------------------------------------------------------- /services/nginx/conf.d/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !certs/localhost/ 4 | !localhost.conf 5 | -------------------------------------------------------------------------------- /services/nginx/conf.d/localhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default; 3 | server_name localhost; 4 | root /www/localhost; 5 | index index.php index.html index.htm; 6 | #charset koi8-r; 7 | 8 | access_log /dev/null; 9 | #access_log /var/log/nginx/nginx.localhost.access.log main; 10 | error_log /var/log/nginx/nginx.localhost.error.log warn; 11 | 12 | #error_page 404 /404.html; 13 | 14 | # redirect server error pages to the static page /50x.html 15 | # 16 | error_page 500 502 503 504 /50x.html; 17 | location = /50x.html { 18 | root /usr/share/nginx/html; 19 | } 20 | 21 | 22 | 23 | 24 | 25 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 26 | # 27 | #location ~ \.php$ { 28 | # proxy_pass http://127.0.0.1; 29 | #} 30 | 31 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 32 | # 33 | location ~ \.php$ { 34 | fastcgi_pass php73:9000; 35 | include fastcgi-php.conf; 36 | include fastcgi_params; 37 | } 38 | 39 | 40 | } -------------------------------------------------------------------------------- /services/nginx/fastcgi-php.conf: -------------------------------------------------------------------------------- 1 | 2 | # regex to split $uri to $fastcgi_script_name and $fastcgi_path 3 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 4 | 5 | # Check that the PHP script exists before passing it 6 | try_files $fastcgi_script_name =404; 7 | 8 | # Bypass the fact that try_files resets $fastcgi_path_info 9 | # see: http://trac.nginx.org/nginx/ticket/321 10 | set $path_info $fastcgi_path_info; 11 | #fastcgi_param PATH_INFO $path_info; 12 | fastcgi_read_timeout 3600; 13 | 14 | fastcgi_index index.php; 15 | -------------------------------------------------------------------------------- /services/nginx/fastcgi_params: -------------------------------------------------------------------------------- 1 | 2 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 3 | fastcgi_param QUERY_STRING $query_string; 4 | fastcgi_param REQUEST_METHOD $request_method; 5 | fastcgi_param CONTENT_TYPE $content_type; 6 | fastcgi_param CONTENT_LENGTH $content_length; 7 | 8 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 9 | fastcgi_param REQUEST_URI $request_uri; 10 | fastcgi_param DOCUMENT_URI $document_uri; 11 | fastcgi_param DOCUMENT_ROOT $document_root; 12 | fastcgi_param SERVER_PROTOCOL $server_protocol; 13 | fastcgi_param REQUEST_SCHEME $scheme; 14 | fastcgi_param HTTPS $https if_not_empty; 15 | 16 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 17 | fastcgi_param SERVER_SOFTWARE nginx; 18 | 19 | fastcgi_param REMOTE_ADDR $remote_addr; 20 | fastcgi_param REMOTE_PORT $remote_port; 21 | fastcgi_param SERVER_ADDR $server_addr; 22 | fastcgi_param SERVER_PORT $server_port; 23 | fastcgi_param SERVER_NAME $server_name; 24 | 25 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 26 | fastcgi_param REDIRECT_STATUS 200; 27 | -------------------------------------------------------------------------------- /services/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | 4 | pid /var/run/nginx.pid; 5 | error_log /var/log/nginx/nginx.error.log warn; 6 | 7 | events { 8 | worker_connections 1024; 9 | } 10 | 11 | 12 | http { 13 | include /etc/nginx/mime.types; 14 | default_type application/octet-stream; 15 | 16 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 17 | '$status $body_bytes_sent "$http_referer" ' 18 | '"$http_user_agent" "$http_x_forwarded_for"'; 19 | 20 | access_log /dev/null; 21 | #access_log /var/log/dnmp/nginx.access.log main; 22 | 23 | # hide verson string 24 | server_tokens off; 25 | sendfile on; 26 | #tcp_nopush on; 27 | client_max_body_size 100M; 28 | 29 | keepalive_timeout 65; 30 | 31 | #gzip on; 32 | 33 | include /etc/nginx/conf.d/*.conf; 34 | } 35 | -------------------------------------------------------------------------------- /services/nginx/ssl/localhost/localhost.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICVTCCAb4CCQDAjEyILRN30zANBgkqhkiG9w0BAQsFADBvMQswCQYDVQQGEwJV 3 | UzENMAsGA1UECAwETWFyczETMBEGA1UEBwwKaVRyYW5zd2FycDETMBEGA1UECgwK 4 | aVRyYW5zd2FycDETMBEGA1UECwwKaVRyYW5zd2FycDESMBAGA1UEAwwJbG9jYWxo 5 | b3N0MB4XDTE4MDkyNTAyMzAyNVoXDTI4MDkyMjAyMzAyNVowbzELMAkGA1UEBhMC 6 | VVMxDTALBgNVBAgMBE1hcnMxEzARBgNVBAcMCmlUcmFuc3dhcnAxEzARBgNVBAoM 7 | CmlUcmFuc3dhcnAxEzARBgNVBAsMCmlUcmFuc3dhcnAxEjAQBgNVBAMMCWxvY2Fs 8 | aG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvF1hXtpa26dj8qKq4rQ8 9 | DYHC36UcghZp7JF8Q9M1ga4+R+M37Tt7rbkVSCbPfBYN0lGJ12CqQUye8wfJ/skr 10 | ol7KJcyfj5Z/z3IZSLegCOkJfxF5vNKzArbb+R2+ek2WdKuTGfOdbj07y1Q52HsS 11 | iOcrl7kUzmkYvxMEA2bqkPsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAeuljNAc0b 12 | wNQCRRzJmfmW2I9kKGQVdHeJwzNE5D3jXlUbUXxBVpw5db548v6TSszicQV1nNav 13 | HiRQsQIbciSdRL7JFSFBbXURVD9LYu7SjtVb5sviZht1t47OpdT/GDYDkx40I3SK 14 | qtCcfeZ0GVupkCCZZM4C26hMZz+LVUaCmw== 15 | -----END CERTIFICATE----- 16 | -------------------------------------------------------------------------------- /services/nginx/ssl/localhost/localhost.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXwIBAAKBgQC8XWFe2lrbp2PyoqritDwNgcLfpRyCFmnskXxD0zWBrj5H4zft 3 | O3utuRVIJs98Fg3SUYnXYKpBTJ7zB8n+ySuiXsolzJ+Pln/PchlIt6AI6Ql/EXm8 4 | 0rMCttv5Hb56TZZ0q5MZ851uPTvLVDnYexKI5yuXuRTOaRi/EwQDZuqQ+wIDAQAB 5 | AoGBALIcFiMLk1gZen+GYtFEnXgkF7FDPaagLP59PqQfhXue19M/vbU7RqIo3T/B 6 | OvXZIK6bXRxjkfl2yuGAnvalH/Shz/YdDtwtItgyYr4rteU5wJnPijPa2ebYXxNV 7 | wxq+9iyZs2vhhbbRGhFxREVE8iu2RnLY12CRxykGmxlWcNDZAkEA9CjA14Ym9gN/ 8 | XwZ8PNe+a/2fe8U0O86VnanOK1G5k5dsZkOW0O/5u622rMlGJw/S+YCBJ+8sOhFL 9 | QTxlVGPCtQJBAMV/79lWoGBGnpoB+o9lc1nBUCCxGmVzywSOrTjIquwegTvjMUUM 10 | yoqEDWC4fNdoFtaFZ12tPk42NYC4BdbU4u8CQQCqOAdJurNK7GFOZH0VBewx6Z3Y 11 | ckHaOEpCovGjbdSNOxJNsW1huQxIdfFXQPNxpCyX2akxqCMTUJ9AmdSjIvHJAkEA 12 | qKajjpimwxALB8CA0krzwcWOQxx5SgEjcHTV/xN8wb0a5qUPwcM2gipZsipYkSlV 13 | t0KcDiaOegNYlN6QPe/1CQJBALtRggJf4bMgjG9vsz/zhe9egCtuUifKfo5LLvI+ 14 | Xua1SY6XGL0Bf8TOGaNXc6Ye9H5abp7q/bZlZ+dGgJ3SJCY= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /services/php56/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 10 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | slowlog = /var/log/php/fpm.slow.log 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | request_slowlog_timeout = 3 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | catch_workers_output = yes 373 | 374 | ; Clear environment in FPM workers 375 | ; Prevents arbitrary environment variables from reaching FPM worker processes 376 | ; by clearing the environment in workers before env vars specified in this 377 | ; pool configuration are added. 378 | ; Setting to "no" will make all environment variables available to PHP code 379 | ; via getenv(), $_ENV and $_SERVER. 380 | ; Default Value: yes 381 | ;clear_env = no 382 | 383 | ; Limits the extensions of the main script FPM will allow to parse. This can 384 | ; prevent configuration mistakes on the web server side. You should only limit 385 | ; FPM to .php extensions to prevent malicious users to use other extensions to 386 | ; execute php code. 387 | ; Note: set an empty value to allow all extensions. 388 | ; Default Value: .php 389 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 390 | 391 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 392 | ; the current environment. 393 | ; Default Value: clean env 394 | ;env[HOSTNAME] = $HOSTNAME 395 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 396 | ;env[TMP] = /tmp 397 | ;env[TMPDIR] = /tmp 398 | ;env[TEMP] = /tmp 399 | 400 | ; Additional php.ini defines, specific to this pool of workers. These settings 401 | ; overwrite the values previously defined in the php.ini. The directives are the 402 | ; same as the PHP SAPI: 403 | ; php_value/php_flag - you can set classic ini defines which can 404 | ; be overwritten from PHP call 'ini_set'. 405 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 406 | ; PHP call 'ini_set' 407 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 408 | 409 | ; Defining 'extension' will load the corresponding shared extension from 410 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 411 | ; overwrite previously defined php.ini values, but will append the new value 412 | ; instead. 413 | 414 | ; Note: path INI options can be relative and will be expanded with the prefix 415 | ; (pool, global or /usr/local) 416 | 417 | ; Default Value: nothing is defined by default except the values in php.ini and 418 | ; specified at startup with the -d argument 419 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 420 | ;php_flag[display_errors] = off 421 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 422 | ;php_admin_flag[log_errors] = on 423 | ;php_admin_value[memory_limit] = 32M 424 | -------------------------------------------------------------------------------- /services/php71/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION 2 | FROM ${PHP_VERSION} 3 | 4 | ARG TZ 5 | ARG PHP_EXTENSIONS 6 | ARG CONTAINER_PACKAGE_URL 7 | 8 | 9 | RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories 10 | 11 | 12 | COPY ./extensions /tmp/extensions 13 | WORKDIR /tmp/extensions 14 | RUN chmod +x install.sh \ 15 | && sh install.sh \ 16 | && rm -rf /tmp/extensions 17 | 18 | 19 | RUN apk --no-cache add tzdata \ 20 | && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ 21 | && echo "$TZ" > /etc/timezone 22 | 23 | 24 | # Fix: https://github.com/docker-library/php/issues/240 25 | RUN apk add gnu-libiconv libstdc++ --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/community/ --allow-untrusted 26 | ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php 27 | 28 | 29 | # Install composer and change it's cache home 30 | RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ 31 | && chmod +x /usr/bin/composer 32 | ENV COMPOSER_HOME=/tmp/composer 33 | 34 | 35 | # php image's www-data user uid & gid are 82, change them to 1000 (primary user) 36 | #RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data 37 | 38 | 39 | WORKDIR /www 40 | -------------------------------------------------------------------------------- /services/php71/extensions/amqp-1.9.4.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/amqp-1.9.4.tgz -------------------------------------------------------------------------------- /services/php71/extensions/apcu-5.1.17.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/apcu-5.1.17.tgz -------------------------------------------------------------------------------- /services/php71/extensions/event-2.5.3.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/event-2.5.3.tgz -------------------------------------------------------------------------------- /services/php71/extensions/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export MC="-j$(nproc)" 4 | 5 | echo 6 | echo "============================================" 7 | echo "Install extensions from : install.sh" 8 | echo "PHP version : ${PHP_VERSION}" 9 | echo "Extra Extensions : ${PHP_EXTENSIONS}" 10 | echo "Multicore Compilation : ${MC}" 11 | echo "Container package url : ${CONTAINER_PACKAGE_URL}" 12 | echo "Work directory : ${PWD}" 13 | echo "============================================" 14 | echo 15 | 16 | 17 | if [ "${PHP_EXTENSIONS}" != "" ]; then 18 | apk --update add --no-cache --virtual .build-deps autoconf g++ libtool make curl-dev gettext-dev linux-headers 19 | fi 20 | 21 | 22 | export EXTENSIONS=",${PHP_EXTENSIONS}," 23 | 24 | 25 | # 26 | # Check if current php version is greater than or equal to 27 | # specific version. 28 | # 29 | # For example, to check if current php is greater than or 30 | # equal to PHP 7.0: 31 | # 32 | # isPhpVersionGreaterOrEqual 7 0 33 | # 34 | # Param 1: Specific PHP Major version 35 | # Param 2: Specific PHP Minor version 36 | # Return : 1 if greater than or equal to, 0 if less than 37 | # 38 | isPhpVersionGreaterOrEqual() 39 | { 40 | local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;") 41 | local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;") 42 | 43 | if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then 44 | return 1; 45 | else 46 | return 0; 47 | fi 48 | } 49 | 50 | 51 | # 52 | # Install extension from package file(.tgz), 53 | # For example: 54 | # 55 | # installExtensionFromTgz redis-5.0.2 56 | # 57 | # Param 1: Package name with version 58 | # Param 2: enable options 59 | # 60 | installExtensionFromTgz() 61 | { 62 | tgzName=$1 63 | extensionName="${tgzName%%-*}" 64 | 65 | mkdir ${extensionName} 66 | tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 67 | ( cd ${extensionName} && phpize && ./configure && make ${MC} && make install ) 68 | 69 | docker-php-ext-enable ${extensionName} $2 70 | } 71 | 72 | 73 | if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then 74 | echo "---------- Install pdo_mysql ----------" 75 | docker-php-ext-install ${MC} pdo_mysql 76 | fi 77 | 78 | if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then 79 | echo "---------- Install pcntl ----------" 80 | docker-php-ext-install ${MC} pcntl 81 | fi 82 | 83 | if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then 84 | echo "---------- Install mysqli ----------" 85 | docker-php-ext-install ${MC} mysqli 86 | fi 87 | 88 | if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then 89 | echo "---------- mbstring is installed ----------" 90 | fi 91 | 92 | if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then 93 | echo "---------- Install exif ----------" 94 | docker-php-ext-install ${MC} exif 95 | fi 96 | 97 | if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then 98 | echo "---------- Install bcmath ----------" 99 | docker-php-ext-install ${MC} bcmath 100 | fi 101 | 102 | if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then 103 | echo "---------- Install calendar ----------" 104 | docker-php-ext-install ${MC} calendar 105 | fi 106 | 107 | if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then 108 | echo "---------- Install zend_test ----------" 109 | docker-php-ext-install ${MC} zend_test 110 | fi 111 | 112 | if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then 113 | echo "---------- Install opcache ----------" 114 | docker-php-ext-install opcache 115 | fi 116 | 117 | if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then 118 | echo "---------- Install sockets ----------" 119 | docker-php-ext-install ${MC} sockets 120 | fi 121 | 122 | if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then 123 | echo "---------- Install gettext ----------" 124 | docker-php-ext-install ${MC} gettext 125 | fi 126 | 127 | if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then 128 | echo "---------- Install shmop ----------" 129 | docker-php-ext-install ${MC} shmop 130 | fi 131 | 132 | if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then 133 | echo "---------- Install sysvmsg ----------" 134 | docker-php-ext-install ${MC} sysvmsg 135 | fi 136 | 137 | if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then 138 | echo "---------- Install sysvsem ----------" 139 | docker-php-ext-install ${MC} sysvsem 140 | fi 141 | 142 | if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then 143 | echo "---------- Install sysvshm ----------" 144 | docker-php-ext-install ${MC} sysvshm 145 | fi 146 | 147 | if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then 148 | echo "---------- Install pdo_firebird ----------" 149 | docker-php-ext-install ${MC} pdo_firebird 150 | fi 151 | 152 | if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then 153 | echo "---------- Install pdo_dblib ----------" 154 | docker-php-ext-install ${MC} pdo_dblib 155 | fi 156 | 157 | if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then 158 | echo "---------- Install pdo_oci ----------" 159 | docker-php-ext-install ${MC} pdo_oci 160 | fi 161 | 162 | if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then 163 | echo "---------- Install pdo_odbc ----------" 164 | docker-php-ext-install ${MC} pdo_odbc 165 | fi 166 | 167 | if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then 168 | echo "---------- Install pdo_pgsql ----------" 169 | apk --no-cache add postgresql-dev \ 170 | && docker-php-ext-install ${MC} pdo_pgsql 171 | fi 172 | 173 | if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then 174 | echo "---------- Install pgsql ----------" 175 | apk --no-cache add postgresql-dev \ 176 | && docker-php-ext-install ${MC} pgsql 177 | fi 178 | 179 | if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then 180 | echo "---------- Install oci8 ----------" 181 | docker-php-ext-install ${MC} oci8 182 | fi 183 | 184 | if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then 185 | echo "---------- Install odbc ----------" 186 | docker-php-ext-install ${MC} odbc 187 | fi 188 | 189 | if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then 190 | echo "---------- Install dba ----------" 191 | docker-php-ext-install ${MC} dba 192 | fi 193 | 194 | if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then 195 | echo "---------- Install interbase ----------" 196 | echo "Alpine linux do not support interbase/firebird!!!" 197 | #docker-php-ext-install ${MC} interbase 198 | fi 199 | 200 | if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then 201 | echo "---------- Install gd ----------" 202 | isPhpVersionGreaterOrEqual 7 4 203 | 204 | if [[ "$?" = "1" ]]; then 205 | # "--with-xxx-dir" was removed from php 7.4, 206 | # issue: https://github.com/docker-library/php/issues/912 207 | options="--with-freetype --with-jpeg" 208 | else 209 | options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/" 210 | fi 211 | 212 | apk add --no-cache \ 213 | freetype \ 214 | freetype-dev \ 215 | libpng \ 216 | libpng-dev \ 217 | libjpeg-turbo \ 218 | libjpeg-turbo-dev \ 219 | && docker-php-ext-configure gd ${options} \ 220 | && docker-php-ext-install ${MC} gd \ 221 | && apk del \ 222 | freetype-dev \ 223 | libpng-dev \ 224 | libjpeg-turbo-dev 225 | fi 226 | 227 | if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then 228 | echo "---------- Install intl ----------" 229 | apk add --no-cache icu-dev 230 | docker-php-ext-install ${MC} intl 231 | fi 232 | 233 | if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then 234 | echo "---------- Install bz2 ----------" 235 | apk add --no-cache bzip2-dev 236 | docker-php-ext-install ${MC} bz2 237 | fi 238 | 239 | if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then 240 | echo "---------- Install soap ----------" 241 | apk add --no-cache libxml2-dev 242 | docker-php-ext-install ${MC} soap 243 | fi 244 | 245 | if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then 246 | echo "---------- Install xsl ----------" 247 | apk add --no-cache libxml2-dev libxslt-dev 248 | docker-php-ext-install ${MC} xsl 249 | fi 250 | 251 | if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then 252 | echo "---------- Install xmlrpc ----------" 253 | apk add --no-cache libxml2-dev libxslt-dev 254 | docker-php-ext-install ${MC} xmlrpc 255 | fi 256 | 257 | if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then 258 | echo "---------- Install wddx ----------" 259 | apk add --no-cache libxml2-dev libxslt-dev 260 | docker-php-ext-install ${MC} wddx 261 | fi 262 | 263 | if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then 264 | echo "---------- curl is installed ----------" 265 | fi 266 | 267 | if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then 268 | echo "---------- Install readline ----------" 269 | apk add --no-cache readline-dev 270 | apk add --no-cache libedit-dev 271 | docker-php-ext-install ${MC} readline 272 | fi 273 | 274 | if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then 275 | echo "---------- Install snmp ----------" 276 | apk add --no-cache net-snmp-dev 277 | docker-php-ext-install ${MC} snmp 278 | fi 279 | 280 | if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then 281 | echo "---------- Install pspell ----------" 282 | apk add --no-cache aspell-dev 283 | apk add --no-cache aspell-en 284 | docker-php-ext-install ${MC} pspell 285 | fi 286 | 287 | if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then 288 | echo "---------- Install recode ----------" 289 | apk add --no-cache recode-dev 290 | docker-php-ext-install ${MC} recode 291 | fi 292 | 293 | if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then 294 | echo "---------- Install tidy ----------" 295 | apk add --no-cache tidyhtml-dev 296 | 297 | # Fix: https://github.com/htacg/tidy-html5/issues/235 298 | ln -s /usr/include/tidybuffio.h /usr/include/buffio.h 299 | 300 | docker-php-ext-install ${MC} tidy 301 | fi 302 | 303 | if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then 304 | echo "---------- Install gmp ----------" 305 | apk add --no-cache gmp-dev 306 | docker-php-ext-install ${MC} gmp 307 | fi 308 | 309 | if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then 310 | echo "---------- Install imap ----------" 311 | apk add --no-cache imap-dev 312 | docker-php-ext-configure imap --with-imap --with-imap-ssl 313 | docker-php-ext-install ${MC} imap 314 | fi 315 | 316 | if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then 317 | echo "---------- Install ldap ----------" 318 | apk add --no-cache ldb-dev 319 | apk add --no-cache openldap-dev 320 | docker-php-ext-install ${MC} ldap 321 | fi 322 | 323 | if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then 324 | echo "---------- Install imagick ----------" 325 | apk add --no-cache file-dev 326 | apk add --no-cache imagemagick-dev 327 | printf "\n" | pecl install imagick-3.4.4 328 | docker-php-ext-enable imagick 329 | fi 330 | 331 | if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then 332 | echo "---------- Install rar ----------" 333 | printf "\n" | pecl install rar 334 | docker-php-ext-enable rar 335 | fi 336 | 337 | if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then 338 | echo "---------- Install ast ----------" 339 | printf "\n" | pecl install ast 340 | docker-php-ext-enable ast 341 | fi 342 | 343 | if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then 344 | echo "---------- Install msgpack ----------" 345 | printf "\n" | pecl install msgpack 346 | docker-php-ext-enable msgpack 347 | fi 348 | 349 | if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then 350 | echo "---------- Install igbinary ----------" 351 | printf "\n" | pecl install igbinary 352 | docker-php-ext-enable igbinary 353 | fi 354 | 355 | 356 | if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then 357 | echo "---------- Install yac ----------" 358 | printf "\n" | pecl install yac-2.0.2 359 | docker-php-ext-enable yac 360 | fi 361 | 362 | if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then 363 | isPhpVersionGreaterOrEqual 7 0 364 | if [[ "$?" = "1" ]]; then 365 | echo "---------- Install yar ----------" 366 | printf "\n" | pecl install yar 367 | docker-php-ext-enable yar 368 | else 369 | echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" 370 | fi 371 | 372 | fi 373 | 374 | 375 | if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then 376 | echo "---------- Install yaconf ----------" 377 | printf "\n" | pecl install yaconf 378 | docker-php-ext-enable yaconf 379 | fi 380 | 381 | if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then 382 | echo "---------- Install seaslog ----------" 383 | printf "\n" | pecl install seaslog 384 | docker-php-ext-enable seaslog 385 | fi 386 | 387 | if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then 388 | echo "---------- Install varnish ----------" 389 | apk add --no-cache varnish-dev 390 | printf "\n" | pecl install varnish 391 | docker-php-ext-enable varnish 392 | fi 393 | 394 | if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then 395 | isPhpVersionGreaterOrEqual 7 1 396 | if [[ "$?" = "1" ]]; then 397 | echo "---------- Install pdo_sqlsrv ----------" 398 | apk add --no-cache unixodbc-dev 399 | printf "\n" | pecl install pdo_sqlsrv 400 | docker-php-ext-enable pdo_sqlsrv 401 | else 402 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 403 | fi 404 | fi 405 | 406 | if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then 407 | isPhpVersionGreaterOrEqual 7 1 408 | if [[ "$?" = "1" ]]; then 409 | echo "---------- Install sqlsrv ----------" 410 | apk add --no-cache unixodbc-dev 411 | printf "\n" | pecl install sqlsrv 412 | docker-php-ext-enable sqlsrv 413 | else 414 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 415 | fi 416 | fi 417 | 418 | if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then 419 | isPhpVersionGreaterOrEqual 7 2 420 | if [[ "$?" = "1" ]]; then 421 | echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------" 422 | else 423 | echo "---------- Install mcrypt ----------" 424 | apk add --no-cache libmcrypt-dev \ 425 | && docker-php-ext-install ${MC} mcrypt 426 | fi 427 | fi 428 | 429 | if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then 430 | isPhpVersionGreaterOrEqual 7 0 431 | 432 | if [[ "$?" = "1" ]]; then 433 | echo "---------- mysql was REMOVED from PHP 7.0.0 ----------" 434 | else 435 | echo "---------- Install mysql ----------" 436 | docker-php-ext-install ${MC} mysql 437 | fi 438 | fi 439 | 440 | if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then 441 | isPhpVersionGreaterOrEqual 7 2 442 | if [[ "$?" = "1" ]]; then 443 | echo 444 | echo "Sodium is bundled with PHP from PHP 7.2.0" 445 | echo 446 | else 447 | echo "---------- Install sodium ----------" 448 | apk add --no-cache libsodium-dev 449 | docker-php-ext-install ${MC} sodium 450 | fi 451 | fi 452 | 453 | if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then 454 | echo "---------- Install amqp ----------" 455 | apk add --no-cache rabbitmq-c-dev 456 | installExtensionFromTgz amqp-1.9.4 457 | fi 458 | 459 | if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then 460 | echo "---------- Install redis ----------" 461 | isPhpVersionGreaterOrEqual 7 0 462 | if [[ "$?" = "1" ]]; then 463 | installExtensionFromTgz redis-5.0.2 464 | else 465 | printf "\n" | pecl install redis-4.3.0 466 | docker-php-ext-enable redis 467 | fi 468 | fi 469 | 470 | if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then 471 | echo "---------- Install apcu ----------" 472 | installExtensionFromTgz apcu-5.1.17 473 | fi 474 | 475 | if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then 476 | echo "---------- Install memcached ----------" 477 | apk add --no-cache libmemcached-dev zlib-dev 478 | isPhpVersionGreaterOrEqual 7 0 479 | 480 | if [[ "$?" = "1" ]]; then 481 | printf "\n" | pecl install memcached-3.1.3 482 | else 483 | printf "\n" | pecl install memcached-2.2.0 484 | fi 485 | 486 | docker-php-ext-enable memcached 487 | fi 488 | 489 | if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then 490 | echo "---------- Install memcache ----------" 491 | isPhpVersionGreaterOrEqual 7 0 492 | if [[ "$?" = "1" ]]; then 493 | installExtensionFromTgz memcache-4.0.5.2 494 | else 495 | installExtensionFromTgz memcache-2.2.6 496 | fi 497 | fi 498 | 499 | if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then 500 | echo "---------- Install xdebug ----------" 501 | isPhpVersionGreaterOrEqual 7 0 502 | 503 | if [[ "$?" = "1" ]]; then 504 | isPhpVersionGreaterOrEqual 7 4 505 | if [[ "$?" = "1" ]]; then 506 | installExtensionFromTgz xdebug-2.9.2 507 | else 508 | installExtensionFromTgz xdebug-2.6.1 509 | fi 510 | else 511 | installExtensionFromTgz xdebug-2.5.5 512 | fi 513 | fi 514 | 515 | if [[ -z "${EXTENSIONS##*,event,*}" ]]; then 516 | echo "---------- Install event ----------" 517 | apk add --no-cache libevent-dev 518 | export is_sockets_installed=$(php -r "echo extension_loaded('sockets');") 519 | 520 | if [[ "${is_sockets_installed}" = "" ]]; then 521 | echo "---------- event is depend on sockets, install sockets first ----------" 522 | docker-php-ext-install sockets 523 | fi 524 | 525 | echo "---------- Install event again ----------" 526 | installExtensionFromTgz event-2.5.3 "--ini-name event.ini" 527 | fi 528 | 529 | if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then 530 | echo "---------- Install mongodb ----------" 531 | installExtensionFromTgz mongodb-1.5.5 532 | fi 533 | 534 | if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then 535 | echo "---------- Install yaf ----------" 536 | isPhpVersionGreaterOrEqual 7 0 537 | 538 | if [[ "$?" = "1" ]]; then 539 | printf "\n" | pecl install yaf 540 | docker-php-ext-enable yaf 541 | else 542 | installExtensionFromTgz yaf-2.3.5 543 | fi 544 | fi 545 | 546 | 547 | if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then 548 | echo "---------- Install swoole ----------" 549 | isPhpVersionGreaterOrEqual 7 0 550 | 551 | if [[ "$?" = "1" ]]; then 552 | installExtensionFromTgz swoole-4.4.2 553 | else 554 | installExtensionFromTgz swoole-2.0.11 555 | fi 556 | fi 557 | 558 | if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then 559 | echo "---------- Install zip ----------" 560 | # Fix: https://github.com/docker-library/php/issues/797 561 | apk add --no-cache libzip-dev 562 | 563 | isPhpVersionGreaterOrEqual 7 4 564 | if [[ "$?" != "1" ]]; then 565 | docker-php-ext-configure zip --with-libzip=/usr/include 566 | fi 567 | 568 | docker-php-ext-install ${MC} zip 569 | fi 570 | 571 | if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then 572 | echo "---------- Install XHProf ----------" 573 | 574 | isPhpVersionGreaterOrEqual 7 0 575 | 576 | if [[ "$?" = "1" ]]; then 577 | mkdir xhprof \ 578 | && tar -xf xhprof-2.1.0.tgz -C xhprof --strip-components=1 \ 579 | && ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \ 580 | && docker-php-ext-enable xhprof 581 | else 582 | echo "---------- PHP Version>= 7.0----------" 583 | fi 584 | 585 | fi 586 | 587 | if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then 588 | echo "---------- Install xlswriter ----------" 589 | isPhpVersionGreaterOrEqual 7 0 590 | 591 | if [[ "$?" = "1" ]]; then 592 | printf "\n" | pecl install xlswriter 593 | docker-php-ext-enable xlswriter 594 | else 595 | echo "---------- PHP Version>= 7.0----------" 596 | fi 597 | fi 598 | 599 | if [ "${PHP_EXTENSIONS}" != "" ]; then 600 | apk del .build-deps \ 601 | && docker-php-source delete 602 | fi 603 | -------------------------------------------------------------------------------- /services/php71/extensions/memcache-2.2.6.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/memcache-2.2.6.tgz -------------------------------------------------------------------------------- /services/php71/extensions/memcache-4.0.5.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/memcache-4.0.5.2.tgz -------------------------------------------------------------------------------- /services/php71/extensions/mongodb-1.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/mongodb-1.5.5.tgz -------------------------------------------------------------------------------- /services/php71/extensions/redis-5.0.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/redis-5.0.2.tgz -------------------------------------------------------------------------------- /services/php71/extensions/swoole-2.0.11.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/swoole-2.0.11.tgz -------------------------------------------------------------------------------- /services/php71/extensions/swoole-4.4.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/swoole-4.4.2.tgz -------------------------------------------------------------------------------- /services/php71/extensions/xdebug-2.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/xdebug-2.5.5.tgz -------------------------------------------------------------------------------- /services/php71/extensions/xdebug-2.6.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/xdebug-2.6.1.tgz -------------------------------------------------------------------------------- /services/php71/extensions/xdebug-2.9.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/xdebug-2.9.2.tgz -------------------------------------------------------------------------------- /services/php71/extensions/xhprof-2.1.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/xhprof-2.1.0.tgz -------------------------------------------------------------------------------- /services/php71/extensions/yaf-2.3.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php71/extensions/yaf-2.3.5.tgz -------------------------------------------------------------------------------- /services/php71/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 10 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | slowlog = /var/log/php/fpm.slow.log 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | request_slowlog_timeout = 3 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | catch_workers_output = yes 373 | 374 | ; Clear environment in FPM workers 375 | ; Prevents arbitrary environment variables from reaching FPM worker processes 376 | ; by clearing the environment in workers before env vars specified in this 377 | ; pool configuration are added. 378 | ; Setting to "no" will make all environment variables available to PHP code 379 | ; via getenv(), $_ENV and $_SERVER. 380 | ; Default Value: yes 381 | ;clear_env = no 382 | 383 | ; Limits the extensions of the main script FPM will allow to parse. This can 384 | ; prevent configuration mistakes on the web server side. You should only limit 385 | ; FPM to .php extensions to prevent malicious users to use other extensions to 386 | ; execute php code. 387 | ; Note: set an empty value to allow all extensions. 388 | ; Default Value: .php 389 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 390 | 391 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 392 | ; the current environment. 393 | ; Default Value: clean env 394 | ;env[HOSTNAME] = $HOSTNAME 395 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 396 | ;env[TMP] = /tmp 397 | ;env[TMPDIR] = /tmp 398 | ;env[TEMP] = /tmp 399 | 400 | ; Additional php.ini defines, specific to this pool of workers. These settings 401 | ; overwrite the values previously defined in the php.ini. The directives are the 402 | ; same as the PHP SAPI: 403 | ; php_value/php_flag - you can set classic ini defines which can 404 | ; be overwritten from PHP call 'ini_set'. 405 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 406 | ; PHP call 'ini_set' 407 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 408 | 409 | ; Defining 'extension' will load the corresponding shared extension from 410 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 411 | ; overwrite previously defined php.ini values, but will append the new value 412 | ; instead. 413 | 414 | ; Note: path INI options can be relative and will be expanded with the prefix 415 | ; (pool, global or /usr/local) 416 | 417 | ; Default Value: nothing is defined by default except the values in php.ini and 418 | ; specified at startup with the -d argument 419 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 420 | ;php_flag[display_errors] = off 421 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 422 | ;php_admin_flag[log_errors] = on 423 | ;php_admin_value[memory_limit] = 32M 424 | -------------------------------------------------------------------------------- /services/php72/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION 2 | FROM ${PHP_VERSION} 3 | 4 | ARG TZ 5 | ARG PHP_EXTENSIONS 6 | ARG CONTAINER_PACKAGE_URL 7 | 8 | 9 | RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories 10 | 11 | 12 | COPY ./extensions /tmp/extensions 13 | WORKDIR /tmp/extensions 14 | RUN chmod +x install.sh \ 15 | && sh install.sh \ 16 | && rm -rf /tmp/extensions 17 | 18 | 19 | RUN apk --no-cache add tzdata \ 20 | && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ 21 | && echo "$TZ" > /etc/timezone 22 | 23 | 24 | # Fix: https://github.com/docker-library/php/issues/240 25 | RUN apk add gnu-libiconv libstdc++ --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/community/ --allow-untrusted 26 | ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php 27 | 28 | 29 | # Install composer and change it's cache home 30 | RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ 31 | && chmod +x /usr/bin/composer 32 | ENV COMPOSER_HOME=/tmp/composer 33 | 34 | 35 | # php image's www-data user uid & gid are 82, change them to 1000 (primary user) 36 | #RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data 37 | 38 | 39 | WORKDIR /www 40 | -------------------------------------------------------------------------------- /services/php72/extensions/amqp-1.9.4.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/amqp-1.9.4.tgz -------------------------------------------------------------------------------- /services/php72/extensions/apcu-5.1.17.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/apcu-5.1.17.tgz -------------------------------------------------------------------------------- /services/php72/extensions/event-2.5.3.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/event-2.5.3.tgz -------------------------------------------------------------------------------- /services/php72/extensions/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export MC="-j$(nproc)" 4 | 5 | echo 6 | echo "============================================" 7 | echo "Install extensions from : install.sh" 8 | echo "PHP version : ${PHP_VERSION}" 9 | echo "Extra Extensions : ${PHP_EXTENSIONS}" 10 | echo "Multicore Compilation : ${MC}" 11 | echo "Container package url : ${CONTAINER_PACKAGE_URL}" 12 | echo "Work directory : ${PWD}" 13 | echo "============================================" 14 | echo 15 | 16 | 17 | if [ "${PHP_EXTENSIONS}" != "" ]; then 18 | apk --update add --no-cache --virtual .build-deps autoconf g++ libtool make curl-dev gettext-dev linux-headers 19 | fi 20 | 21 | 22 | export EXTENSIONS=",${PHP_EXTENSIONS}," 23 | 24 | 25 | # 26 | # Check if current php version is greater than or equal to 27 | # specific version. 28 | # 29 | # For example, to check if current php is greater than or 30 | # equal to PHP 7.0: 31 | # 32 | # isPhpVersionGreaterOrEqual 7 0 33 | # 34 | # Param 1: Specific PHP Major version 35 | # Param 2: Specific PHP Minor version 36 | # Return : 1 if greater than or equal to, 0 if less than 37 | # 38 | isPhpVersionGreaterOrEqual() 39 | { 40 | local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;") 41 | local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;") 42 | 43 | if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then 44 | return 1; 45 | else 46 | return 0; 47 | fi 48 | } 49 | 50 | 51 | # 52 | # Install extension from package file(.tgz), 53 | # For example: 54 | # 55 | # installExtensionFromTgz redis-5.0.2 56 | # 57 | # Param 1: Package name with version 58 | # Param 2: enable options 59 | # 60 | installExtensionFromTgz() 61 | { 62 | tgzName=$1 63 | extensionName="${tgzName%%-*}" 64 | 65 | mkdir ${extensionName} 66 | tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 67 | ( cd ${extensionName} && phpize && ./configure && make ${MC} && make install ) 68 | 69 | docker-php-ext-enable ${extensionName} $2 70 | } 71 | 72 | 73 | if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then 74 | echo "---------- Install pdo_mysql ----------" 75 | docker-php-ext-install ${MC} pdo_mysql 76 | fi 77 | 78 | if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then 79 | echo "---------- Install pcntl ----------" 80 | docker-php-ext-install ${MC} pcntl 81 | fi 82 | 83 | if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then 84 | echo "---------- Install mysqli ----------" 85 | docker-php-ext-install ${MC} mysqli 86 | fi 87 | 88 | if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then 89 | echo "---------- mbstring is installed ----------" 90 | fi 91 | 92 | if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then 93 | echo "---------- Install exif ----------" 94 | docker-php-ext-install ${MC} exif 95 | fi 96 | 97 | if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then 98 | echo "---------- Install bcmath ----------" 99 | docker-php-ext-install ${MC} bcmath 100 | fi 101 | 102 | if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then 103 | echo "---------- Install calendar ----------" 104 | docker-php-ext-install ${MC} calendar 105 | fi 106 | 107 | if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then 108 | echo "---------- Install zend_test ----------" 109 | docker-php-ext-install ${MC} zend_test 110 | fi 111 | 112 | if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then 113 | echo "---------- Install opcache ----------" 114 | docker-php-ext-install opcache 115 | fi 116 | 117 | if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then 118 | echo "---------- Install sockets ----------" 119 | docker-php-ext-install ${MC} sockets 120 | fi 121 | 122 | if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then 123 | echo "---------- Install gettext ----------" 124 | docker-php-ext-install ${MC} gettext 125 | fi 126 | 127 | if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then 128 | echo "---------- Install shmop ----------" 129 | docker-php-ext-install ${MC} shmop 130 | fi 131 | 132 | if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then 133 | echo "---------- Install sysvmsg ----------" 134 | docker-php-ext-install ${MC} sysvmsg 135 | fi 136 | 137 | if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then 138 | echo "---------- Install sysvsem ----------" 139 | docker-php-ext-install ${MC} sysvsem 140 | fi 141 | 142 | if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then 143 | echo "---------- Install sysvshm ----------" 144 | docker-php-ext-install ${MC} sysvshm 145 | fi 146 | 147 | if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then 148 | echo "---------- Install pdo_firebird ----------" 149 | docker-php-ext-install ${MC} pdo_firebird 150 | fi 151 | 152 | if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then 153 | echo "---------- Install pdo_dblib ----------" 154 | docker-php-ext-install ${MC} pdo_dblib 155 | fi 156 | 157 | if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then 158 | echo "---------- Install pdo_oci ----------" 159 | docker-php-ext-install ${MC} pdo_oci 160 | fi 161 | 162 | if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then 163 | echo "---------- Install pdo_odbc ----------" 164 | docker-php-ext-install ${MC} pdo_odbc 165 | fi 166 | 167 | if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then 168 | echo "---------- Install pdo_pgsql ----------" 169 | apk --no-cache add postgresql-dev \ 170 | && docker-php-ext-install ${MC} pdo_pgsql 171 | fi 172 | 173 | if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then 174 | echo "---------- Install pgsql ----------" 175 | apk --no-cache add postgresql-dev \ 176 | && docker-php-ext-install ${MC} pgsql 177 | fi 178 | 179 | if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then 180 | echo "---------- Install oci8 ----------" 181 | docker-php-ext-install ${MC} oci8 182 | fi 183 | 184 | if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then 185 | echo "---------- Install odbc ----------" 186 | docker-php-ext-install ${MC} odbc 187 | fi 188 | 189 | if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then 190 | echo "---------- Install dba ----------" 191 | docker-php-ext-install ${MC} dba 192 | fi 193 | 194 | if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then 195 | echo "---------- Install interbase ----------" 196 | echo "Alpine linux do not support interbase/firebird!!!" 197 | #docker-php-ext-install ${MC} interbase 198 | fi 199 | 200 | if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then 201 | echo "---------- Install gd ----------" 202 | isPhpVersionGreaterOrEqual 7 4 203 | 204 | if [[ "$?" = "1" ]]; then 205 | # "--with-xxx-dir" was removed from php 7.4, 206 | # issue: https://github.com/docker-library/php/issues/912 207 | options="--with-freetype --with-jpeg" 208 | else 209 | options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/" 210 | fi 211 | 212 | apk add --no-cache \ 213 | freetype \ 214 | freetype-dev \ 215 | libpng \ 216 | libpng-dev \ 217 | libjpeg-turbo \ 218 | libjpeg-turbo-dev \ 219 | && docker-php-ext-configure gd ${options} \ 220 | && docker-php-ext-install ${MC} gd \ 221 | && apk del \ 222 | freetype-dev \ 223 | libpng-dev \ 224 | libjpeg-turbo-dev 225 | fi 226 | 227 | if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then 228 | echo "---------- Install intl ----------" 229 | apk add --no-cache icu-dev 230 | docker-php-ext-install ${MC} intl 231 | fi 232 | 233 | if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then 234 | echo "---------- Install bz2 ----------" 235 | apk add --no-cache bzip2-dev 236 | docker-php-ext-install ${MC} bz2 237 | fi 238 | 239 | if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then 240 | echo "---------- Install soap ----------" 241 | apk add --no-cache libxml2-dev 242 | docker-php-ext-install ${MC} soap 243 | fi 244 | 245 | if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then 246 | echo "---------- Install xsl ----------" 247 | apk add --no-cache libxml2-dev libxslt-dev 248 | docker-php-ext-install ${MC} xsl 249 | fi 250 | 251 | if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then 252 | echo "---------- Install xmlrpc ----------" 253 | apk add --no-cache libxml2-dev libxslt-dev 254 | docker-php-ext-install ${MC} xmlrpc 255 | fi 256 | 257 | if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then 258 | echo "---------- Install wddx ----------" 259 | apk add --no-cache libxml2-dev libxslt-dev 260 | docker-php-ext-install ${MC} wddx 261 | fi 262 | 263 | if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then 264 | echo "---------- curl is installed ----------" 265 | fi 266 | 267 | if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then 268 | echo "---------- Install readline ----------" 269 | apk add --no-cache readline-dev 270 | apk add --no-cache libedit-dev 271 | docker-php-ext-install ${MC} readline 272 | fi 273 | 274 | if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then 275 | echo "---------- Install snmp ----------" 276 | apk add --no-cache net-snmp-dev 277 | docker-php-ext-install ${MC} snmp 278 | fi 279 | 280 | if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then 281 | echo "---------- Install pspell ----------" 282 | apk add --no-cache aspell-dev 283 | apk add --no-cache aspell-en 284 | docker-php-ext-install ${MC} pspell 285 | fi 286 | 287 | if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then 288 | echo "---------- Install recode ----------" 289 | apk add --no-cache recode-dev 290 | docker-php-ext-install ${MC} recode 291 | fi 292 | 293 | if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then 294 | echo "---------- Install tidy ----------" 295 | apk add --no-cache tidyhtml-dev 296 | 297 | # Fix: https://github.com/htacg/tidy-html5/issues/235 298 | ln -s /usr/include/tidybuffio.h /usr/include/buffio.h 299 | 300 | docker-php-ext-install ${MC} tidy 301 | fi 302 | 303 | if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then 304 | echo "---------- Install gmp ----------" 305 | apk add --no-cache gmp-dev 306 | docker-php-ext-install ${MC} gmp 307 | fi 308 | 309 | if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then 310 | echo "---------- Install imap ----------" 311 | apk add --no-cache imap-dev 312 | docker-php-ext-configure imap --with-imap --with-imap-ssl 313 | docker-php-ext-install ${MC} imap 314 | fi 315 | 316 | if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then 317 | echo "---------- Install ldap ----------" 318 | apk add --no-cache ldb-dev 319 | apk add --no-cache openldap-dev 320 | docker-php-ext-install ${MC} ldap 321 | fi 322 | 323 | if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then 324 | echo "---------- Install imagick ----------" 325 | apk add --no-cache file-dev 326 | apk add --no-cache imagemagick-dev 327 | printf "\n" | pecl install imagick-3.4.4 328 | docker-php-ext-enable imagick 329 | fi 330 | 331 | if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then 332 | echo "---------- Install rar ----------" 333 | printf "\n" | pecl install rar 334 | docker-php-ext-enable rar 335 | fi 336 | 337 | if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then 338 | echo "---------- Install ast ----------" 339 | printf "\n" | pecl install ast 340 | docker-php-ext-enable ast 341 | fi 342 | 343 | if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then 344 | echo "---------- Install msgpack ----------" 345 | printf "\n" | pecl install msgpack 346 | docker-php-ext-enable msgpack 347 | fi 348 | 349 | if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then 350 | echo "---------- Install igbinary ----------" 351 | printf "\n" | pecl install igbinary 352 | docker-php-ext-enable igbinary 353 | fi 354 | 355 | 356 | if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then 357 | echo "---------- Install yac ----------" 358 | printf "\n" | pecl install yac-2.0.2 359 | docker-php-ext-enable yac 360 | fi 361 | 362 | if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then 363 | isPhpVersionGreaterOrEqual 7 0 364 | if [[ "$?" = "1" ]]; then 365 | echo "---------- Install yar ----------" 366 | printf "\n" | pecl install yar 367 | docker-php-ext-enable yar 368 | else 369 | echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" 370 | fi 371 | 372 | fi 373 | 374 | 375 | if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then 376 | echo "---------- Install yaconf ----------" 377 | printf "\n" | pecl install yaconf 378 | docker-php-ext-enable yaconf 379 | fi 380 | 381 | if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then 382 | echo "---------- Install seaslog ----------" 383 | printf "\n" | pecl install seaslog 384 | docker-php-ext-enable seaslog 385 | fi 386 | 387 | if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then 388 | echo "---------- Install varnish ----------" 389 | apk add --no-cache varnish-dev 390 | printf "\n" | pecl install varnish 391 | docker-php-ext-enable varnish 392 | fi 393 | 394 | if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then 395 | isPhpVersionGreaterOrEqual 7 1 396 | if [[ "$?" = "1" ]]; then 397 | echo "---------- Install pdo_sqlsrv ----------" 398 | apk add --no-cache unixodbc-dev 399 | printf "\n" | pecl install pdo_sqlsrv 400 | docker-php-ext-enable pdo_sqlsrv 401 | else 402 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 403 | fi 404 | fi 405 | 406 | if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then 407 | isPhpVersionGreaterOrEqual 7 1 408 | if [[ "$?" = "1" ]]; then 409 | echo "---------- Install sqlsrv ----------" 410 | apk add --no-cache unixodbc-dev 411 | printf "\n" | pecl install sqlsrv 412 | docker-php-ext-enable sqlsrv 413 | else 414 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 415 | fi 416 | fi 417 | 418 | if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then 419 | isPhpVersionGreaterOrEqual 7 2 420 | if [[ "$?" = "1" ]]; then 421 | echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------" 422 | else 423 | echo "---------- Install mcrypt ----------" 424 | apk add --no-cache libmcrypt-dev \ 425 | && docker-php-ext-install ${MC} mcrypt 426 | fi 427 | fi 428 | 429 | if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then 430 | isPhpVersionGreaterOrEqual 7 0 431 | 432 | if [[ "$?" = "1" ]]; then 433 | echo "---------- mysql was REMOVED from PHP 7.0.0 ----------" 434 | else 435 | echo "---------- Install mysql ----------" 436 | docker-php-ext-install ${MC} mysql 437 | fi 438 | fi 439 | 440 | if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then 441 | isPhpVersionGreaterOrEqual 7 2 442 | if [[ "$?" = "1" ]]; then 443 | echo 444 | echo "Sodium is bundled with PHP from PHP 7.2.0" 445 | echo 446 | else 447 | echo "---------- Install sodium ----------" 448 | apk add --no-cache libsodium-dev 449 | docker-php-ext-install ${MC} sodium 450 | fi 451 | fi 452 | 453 | if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then 454 | echo "---------- Install amqp ----------" 455 | apk add --no-cache rabbitmq-c-dev 456 | installExtensionFromTgz amqp-1.9.4 457 | fi 458 | 459 | if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then 460 | echo "---------- Install redis ----------" 461 | isPhpVersionGreaterOrEqual 7 0 462 | if [[ "$?" = "1" ]]; then 463 | installExtensionFromTgz redis-5.0.2 464 | else 465 | printf "\n" | pecl install redis-4.3.0 466 | docker-php-ext-enable redis 467 | fi 468 | fi 469 | 470 | if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then 471 | echo "---------- Install apcu ----------" 472 | installExtensionFromTgz apcu-5.1.17 473 | fi 474 | 475 | if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then 476 | echo "---------- Install memcached ----------" 477 | apk add --no-cache libmemcached-dev zlib-dev 478 | isPhpVersionGreaterOrEqual 7 0 479 | 480 | if [[ "$?" = "1" ]]; then 481 | printf "\n" | pecl install memcached-3.1.3 482 | else 483 | printf "\n" | pecl install memcached-2.2.0 484 | fi 485 | 486 | docker-php-ext-enable memcached 487 | fi 488 | 489 | if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then 490 | echo "---------- Install memcache ----------" 491 | isPhpVersionGreaterOrEqual 7 0 492 | if [[ "$?" = "1" ]]; then 493 | installExtensionFromTgz memcache-4.0.5.2 494 | else 495 | installExtensionFromTgz memcache-2.2.6 496 | fi 497 | fi 498 | 499 | if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then 500 | echo "---------- Install xdebug ----------" 501 | isPhpVersionGreaterOrEqual 7 0 502 | 503 | if [[ "$?" = "1" ]]; then 504 | isPhpVersionGreaterOrEqual 7 4 505 | if [[ "$?" = "1" ]]; then 506 | installExtensionFromTgz xdebug-2.9.2 507 | else 508 | installExtensionFromTgz xdebug-2.6.1 509 | fi 510 | else 511 | installExtensionFromTgz xdebug-2.5.5 512 | fi 513 | fi 514 | 515 | if [[ -z "${EXTENSIONS##*,event,*}" ]]; then 516 | echo "---------- Install event ----------" 517 | apk add --no-cache libevent-dev 518 | export is_sockets_installed=$(php -r "echo extension_loaded('sockets');") 519 | 520 | if [[ "${is_sockets_installed}" = "" ]]; then 521 | echo "---------- event is depend on sockets, install sockets first ----------" 522 | docker-php-ext-install sockets 523 | fi 524 | 525 | echo "---------- Install event again ----------" 526 | installExtensionFromTgz event-2.5.3 "--ini-name event.ini" 527 | fi 528 | 529 | if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then 530 | echo "---------- Install mongodb ----------" 531 | installExtensionFromTgz mongodb-1.5.5 532 | fi 533 | 534 | if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then 535 | echo "---------- Install yaf ----------" 536 | isPhpVersionGreaterOrEqual 7 0 537 | 538 | if [[ "$?" = "1" ]]; then 539 | printf "\n" | pecl install yaf 540 | docker-php-ext-enable yaf 541 | else 542 | installExtensionFromTgz yaf-2.3.5 543 | fi 544 | fi 545 | 546 | 547 | if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then 548 | echo "---------- Install swoole ----------" 549 | isPhpVersionGreaterOrEqual 7 0 550 | 551 | if [[ "$?" = "1" ]]; then 552 | installExtensionFromTgz swoole-4.4.2 553 | else 554 | installExtensionFromTgz swoole-2.0.11 555 | fi 556 | fi 557 | 558 | if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then 559 | echo "---------- Install zip ----------" 560 | # Fix: https://github.com/docker-library/php/issues/797 561 | apk add --no-cache libzip-dev 562 | 563 | isPhpVersionGreaterOrEqual 7 4 564 | if [[ "$?" != "1" ]]; then 565 | docker-php-ext-configure zip --with-libzip=/usr/include 566 | fi 567 | 568 | docker-php-ext-install ${MC} zip 569 | fi 570 | 571 | if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then 572 | echo "---------- Install XHProf ----------" 573 | 574 | isPhpVersionGreaterOrEqual 7 0 575 | 576 | if [[ "$?" = "1" ]]; then 577 | mkdir xhprof \ 578 | && tar -xf xhprof-2.1.0.tgz -C xhprof --strip-components=1 \ 579 | && ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \ 580 | && docker-php-ext-enable xhprof 581 | else 582 | echo "---------- PHP Version>= 7.0----------" 583 | fi 584 | 585 | fi 586 | 587 | if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then 588 | echo "---------- Install xlswriter ----------" 589 | isPhpVersionGreaterOrEqual 7 0 590 | 591 | if [[ "$?" = "1" ]]; then 592 | printf "\n" | pecl install xlswriter 593 | docker-php-ext-enable xlswriter 594 | else 595 | echo "---------- PHP Version>= 7.0----------" 596 | fi 597 | fi 598 | 599 | if [ "${PHP_EXTENSIONS}" != "" ]; then 600 | apk del .build-deps \ 601 | && docker-php-source delete 602 | fi 603 | -------------------------------------------------------------------------------- /services/php72/extensions/memcache-2.2.6.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/memcache-2.2.6.tgz -------------------------------------------------------------------------------- /services/php72/extensions/memcache-4.0.5.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/memcache-4.0.5.2.tgz -------------------------------------------------------------------------------- /services/php72/extensions/mongodb-1.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/mongodb-1.5.5.tgz -------------------------------------------------------------------------------- /services/php72/extensions/redis-5.0.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/redis-5.0.2.tgz -------------------------------------------------------------------------------- /services/php72/extensions/swoole-2.0.11.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/swoole-2.0.11.tgz -------------------------------------------------------------------------------- /services/php72/extensions/swoole-4.4.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/swoole-4.4.2.tgz -------------------------------------------------------------------------------- /services/php72/extensions/xdebug-2.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/xdebug-2.5.5.tgz -------------------------------------------------------------------------------- /services/php72/extensions/xdebug-2.6.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/xdebug-2.6.1.tgz -------------------------------------------------------------------------------- /services/php72/extensions/xdebug-2.9.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/xdebug-2.9.2.tgz -------------------------------------------------------------------------------- /services/php72/extensions/xhprof-2.1.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/xhprof-2.1.0.tgz -------------------------------------------------------------------------------- /services/php72/extensions/yaf-2.3.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php72/extensions/yaf-2.3.5.tgz -------------------------------------------------------------------------------- /services/php72/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 10 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | slowlog = /var/log/php/fpm.slow.log 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | request_slowlog_timeout = 3 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | catch_workers_output = yes 373 | 374 | ; Clear environment in FPM workers 375 | ; Prevents arbitrary environment variables from reaching FPM worker processes 376 | ; by clearing the environment in workers before env vars specified in this 377 | ; pool configuration are added. 378 | ; Setting to "no" will make all environment variables available to PHP code 379 | ; via getenv(), $_ENV and $_SERVER. 380 | ; Default Value: yes 381 | ;clear_env = no 382 | 383 | ; Limits the extensions of the main script FPM will allow to parse. This can 384 | ; prevent configuration mistakes on the web server side. You should only limit 385 | ; FPM to .php extensions to prevent malicious users to use other extensions to 386 | ; execute php code. 387 | ; Note: set an empty value to allow all extensions. 388 | ; Default Value: .php 389 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 390 | 391 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 392 | ; the current environment. 393 | ; Default Value: clean env 394 | ;env[HOSTNAME] = $HOSTNAME 395 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 396 | ;env[TMP] = /tmp 397 | ;env[TMPDIR] = /tmp 398 | ;env[TEMP] = /tmp 399 | 400 | ; Additional php.ini defines, specific to this pool of workers. These settings 401 | ; overwrite the values previously defined in the php.ini. The directives are the 402 | ; same as the PHP SAPI: 403 | ; php_value/php_flag - you can set classic ini defines which can 404 | ; be overwritten from PHP call 'ini_set'. 405 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 406 | ; PHP call 'ini_set' 407 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 408 | 409 | ; Defining 'extension' will load the corresponding shared extension from 410 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 411 | ; overwrite previously defined php.ini values, but will append the new value 412 | ; instead. 413 | 414 | ; Note: path INI options can be relative and will be expanded with the prefix 415 | ; (pool, global or /usr/local) 416 | 417 | ; Default Value: nothing is defined by default except the values in php.ini and 418 | ; specified at startup with the -d argument 419 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 420 | ;php_flag[display_errors] = off 421 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 422 | ;php_admin_flag[log_errors] = on 423 | ;php_admin_value[memory_limit] = 32M 424 | -------------------------------------------------------------------------------- /services/php73/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION 2 | FROM ${PHP_VERSION} 3 | 4 | ARG TZ 5 | ARG PHP_EXTENSIONS 6 | ARG CONTAINER_PACKAGE_URL 7 | 8 | 9 | RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories 10 | 11 | 12 | COPY ./extensions /tmp/extensions 13 | WORKDIR /tmp/extensions 14 | RUN chmod +x install.sh \ 15 | && sh install.sh \ 16 | && rm -rf /tmp/extensions 17 | 18 | 19 | RUN apk --no-cache add tzdata \ 20 | && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ 21 | && echo "$TZ" > /etc/timezone 22 | 23 | 24 | # Fix: https://github.com/docker-library/php/issues/240 25 | RUN apk add gnu-libiconv libstdc++ --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/community/ --allow-untrusted 26 | ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php 27 | 28 | 29 | # Install composer and change it's cache home 30 | RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ 31 | && chmod +x /usr/bin/composer 32 | ENV COMPOSER_HOME=/tmp/composer 33 | 34 | 35 | # php image's www-data user uid & gid are 82, change them to 1000 (primary user) 36 | #RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data 37 | 38 | 39 | WORKDIR /www 40 | -------------------------------------------------------------------------------- /services/php73/extensions/amqp-1.9.4.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/amqp-1.9.4.tgz -------------------------------------------------------------------------------- /services/php73/extensions/apcu-5.1.17.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/apcu-5.1.17.tgz -------------------------------------------------------------------------------- /services/php73/extensions/event-2.5.3.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/event-2.5.3.tgz -------------------------------------------------------------------------------- /services/php73/extensions/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export MC="-j$(nproc)" 4 | 5 | echo 6 | echo "============================================" 7 | echo "Install extensions from : install.sh" 8 | echo "PHP version : ${PHP_VERSION}" 9 | echo "Extra Extensions : ${PHP_EXTENSIONS}" 10 | echo "Multicore Compilation : ${MC}" 11 | echo "Container package url : ${CONTAINER_PACKAGE_URL}" 12 | echo "Work directory : ${PWD}" 13 | echo "============================================" 14 | echo 15 | 16 | 17 | if [ "${PHP_EXTENSIONS}" != "" ]; then 18 | apk --update add --no-cache --virtual .build-deps autoconf g++ libtool make curl-dev gettext-dev linux-headers 19 | fi 20 | 21 | 22 | export EXTENSIONS=",${PHP_EXTENSIONS}," 23 | 24 | 25 | # 26 | # Check if current php version is greater than or equal to 27 | # specific version. 28 | # 29 | # For example, to check if current php is greater than or 30 | # equal to PHP 7.0: 31 | # 32 | # isPhpVersionGreaterOrEqual 7 0 33 | # 34 | # Param 1: Specific PHP Major version 35 | # Param 2: Specific PHP Minor version 36 | # Return : 1 if greater than or equal to, 0 if less than 37 | # 38 | isPhpVersionGreaterOrEqual() 39 | { 40 | local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;") 41 | local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;") 42 | 43 | if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then 44 | return 1; 45 | else 46 | return 0; 47 | fi 48 | } 49 | 50 | 51 | # 52 | # Install extension from package file(.tgz), 53 | # For example: 54 | # 55 | # installExtensionFromTgz redis-5.0.2 56 | # 57 | # Param 1: Package name with version 58 | # Param 2: enable options 59 | # 60 | installExtensionFromTgz() 61 | { 62 | tgzName=$1 63 | extensionName="${tgzName%%-*}" 64 | 65 | mkdir ${extensionName} 66 | tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 67 | ( cd ${extensionName} && phpize && ./configure && make ${MC} && make install ) 68 | 69 | docker-php-ext-enable ${extensionName} $2 70 | } 71 | 72 | 73 | if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then 74 | echo "---------- Install pdo_mysql ----------" 75 | docker-php-ext-install ${MC} pdo_mysql 76 | fi 77 | 78 | if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then 79 | echo "---------- Install pcntl ----------" 80 | docker-php-ext-install ${MC} pcntl 81 | fi 82 | 83 | if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then 84 | echo "---------- Install mysqli ----------" 85 | docker-php-ext-install ${MC} mysqli 86 | fi 87 | 88 | if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then 89 | echo "---------- mbstring is installed ----------" 90 | fi 91 | 92 | if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then 93 | echo "---------- Install exif ----------" 94 | docker-php-ext-install ${MC} exif 95 | fi 96 | 97 | if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then 98 | echo "---------- Install bcmath ----------" 99 | docker-php-ext-install ${MC} bcmath 100 | fi 101 | 102 | if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then 103 | echo "---------- Install calendar ----------" 104 | docker-php-ext-install ${MC} calendar 105 | fi 106 | 107 | if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then 108 | echo "---------- Install zend_test ----------" 109 | docker-php-ext-install ${MC} zend_test 110 | fi 111 | 112 | if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then 113 | echo "---------- Install opcache ----------" 114 | docker-php-ext-install opcache 115 | fi 116 | 117 | if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then 118 | echo "---------- Install sockets ----------" 119 | docker-php-ext-install ${MC} sockets 120 | fi 121 | 122 | if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then 123 | echo "---------- Install gettext ----------" 124 | docker-php-ext-install ${MC} gettext 125 | fi 126 | 127 | if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then 128 | echo "---------- Install shmop ----------" 129 | docker-php-ext-install ${MC} shmop 130 | fi 131 | 132 | if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then 133 | echo "---------- Install sysvmsg ----------" 134 | docker-php-ext-install ${MC} sysvmsg 135 | fi 136 | 137 | if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then 138 | echo "---------- Install sysvsem ----------" 139 | docker-php-ext-install ${MC} sysvsem 140 | fi 141 | 142 | if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then 143 | echo "---------- Install sysvshm ----------" 144 | docker-php-ext-install ${MC} sysvshm 145 | fi 146 | 147 | if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then 148 | echo "---------- Install pdo_firebird ----------" 149 | docker-php-ext-install ${MC} pdo_firebird 150 | fi 151 | 152 | if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then 153 | echo "---------- Install pdo_dblib ----------" 154 | docker-php-ext-install ${MC} pdo_dblib 155 | fi 156 | 157 | if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then 158 | echo "---------- Install pdo_oci ----------" 159 | docker-php-ext-install ${MC} pdo_oci 160 | fi 161 | 162 | if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then 163 | echo "---------- Install pdo_odbc ----------" 164 | docker-php-ext-install ${MC} pdo_odbc 165 | fi 166 | 167 | if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then 168 | echo "---------- Install pdo_pgsql ----------" 169 | apk --no-cache add postgresql-dev \ 170 | && docker-php-ext-install ${MC} pdo_pgsql 171 | fi 172 | 173 | if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then 174 | echo "---------- Install pgsql ----------" 175 | apk --no-cache add postgresql-dev \ 176 | && docker-php-ext-install ${MC} pgsql 177 | fi 178 | 179 | if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then 180 | echo "---------- Install oci8 ----------" 181 | docker-php-ext-install ${MC} oci8 182 | fi 183 | 184 | if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then 185 | echo "---------- Install odbc ----------" 186 | docker-php-ext-install ${MC} odbc 187 | fi 188 | 189 | if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then 190 | echo "---------- Install dba ----------" 191 | docker-php-ext-install ${MC} dba 192 | fi 193 | 194 | if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then 195 | echo "---------- Install interbase ----------" 196 | echo "Alpine linux do not support interbase/firebird!!!" 197 | #docker-php-ext-install ${MC} interbase 198 | fi 199 | 200 | if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then 201 | echo "---------- Install gd ----------" 202 | isPhpVersionGreaterOrEqual 7 4 203 | 204 | if [[ "$?" = "1" ]]; then 205 | # "--with-xxx-dir" was removed from php 7.4, 206 | # issue: https://github.com/docker-library/php/issues/912 207 | options="--with-freetype --with-jpeg" 208 | else 209 | options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/" 210 | fi 211 | 212 | apk add --no-cache \ 213 | freetype \ 214 | freetype-dev \ 215 | libpng \ 216 | libpng-dev \ 217 | libjpeg-turbo \ 218 | libjpeg-turbo-dev \ 219 | && docker-php-ext-configure gd ${options} \ 220 | && docker-php-ext-install ${MC} gd \ 221 | && apk del \ 222 | freetype-dev \ 223 | libpng-dev \ 224 | libjpeg-turbo-dev 225 | fi 226 | 227 | if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then 228 | echo "---------- Install intl ----------" 229 | apk add --no-cache icu-dev 230 | docker-php-ext-install ${MC} intl 231 | fi 232 | 233 | if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then 234 | echo "---------- Install bz2 ----------" 235 | apk add --no-cache bzip2-dev 236 | docker-php-ext-install ${MC} bz2 237 | fi 238 | 239 | if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then 240 | echo "---------- Install soap ----------" 241 | apk add --no-cache libxml2-dev 242 | docker-php-ext-install ${MC} soap 243 | fi 244 | 245 | if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then 246 | echo "---------- Install xsl ----------" 247 | apk add --no-cache libxml2-dev libxslt-dev 248 | docker-php-ext-install ${MC} xsl 249 | fi 250 | 251 | if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then 252 | echo "---------- Install xmlrpc ----------" 253 | apk add --no-cache libxml2-dev libxslt-dev 254 | docker-php-ext-install ${MC} xmlrpc 255 | fi 256 | 257 | if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then 258 | echo "---------- Install wddx ----------" 259 | apk add --no-cache libxml2-dev libxslt-dev 260 | docker-php-ext-install ${MC} wddx 261 | fi 262 | 263 | if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then 264 | echo "---------- curl is installed ----------" 265 | fi 266 | 267 | if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then 268 | echo "---------- Install readline ----------" 269 | apk add --no-cache readline-dev 270 | apk add --no-cache libedit-dev 271 | docker-php-ext-install ${MC} readline 272 | fi 273 | 274 | if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then 275 | echo "---------- Install snmp ----------" 276 | apk add --no-cache net-snmp-dev 277 | docker-php-ext-install ${MC} snmp 278 | fi 279 | 280 | if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then 281 | echo "---------- Install pspell ----------" 282 | apk add --no-cache aspell-dev 283 | apk add --no-cache aspell-en 284 | docker-php-ext-install ${MC} pspell 285 | fi 286 | 287 | if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then 288 | echo "---------- Install recode ----------" 289 | apk add --no-cache recode-dev 290 | docker-php-ext-install ${MC} recode 291 | fi 292 | 293 | if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then 294 | echo "---------- Install tidy ----------" 295 | apk add --no-cache tidyhtml-dev 296 | 297 | # Fix: https://github.com/htacg/tidy-html5/issues/235 298 | ln -s /usr/include/tidybuffio.h /usr/include/buffio.h 299 | 300 | docker-php-ext-install ${MC} tidy 301 | fi 302 | 303 | if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then 304 | echo "---------- Install gmp ----------" 305 | apk add --no-cache gmp-dev 306 | docker-php-ext-install ${MC} gmp 307 | fi 308 | 309 | if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then 310 | echo "---------- Install imap ----------" 311 | apk add --no-cache imap-dev 312 | docker-php-ext-configure imap --with-imap --with-imap-ssl 313 | docker-php-ext-install ${MC} imap 314 | fi 315 | 316 | if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then 317 | echo "---------- Install ldap ----------" 318 | apk add --no-cache ldb-dev 319 | apk add --no-cache openldap-dev 320 | docker-php-ext-install ${MC} ldap 321 | fi 322 | 323 | if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then 324 | echo "---------- Install imagick ----------" 325 | apk add --no-cache file-dev 326 | apk add --no-cache imagemagick-dev 327 | printf "\n" | pecl install imagick-3.4.4 328 | docker-php-ext-enable imagick 329 | fi 330 | 331 | if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then 332 | echo "---------- Install rar ----------" 333 | printf "\n" | pecl install rar 334 | docker-php-ext-enable rar 335 | fi 336 | 337 | if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then 338 | echo "---------- Install ast ----------" 339 | printf "\n" | pecl install ast 340 | docker-php-ext-enable ast 341 | fi 342 | 343 | if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then 344 | echo "---------- Install msgpack ----------" 345 | printf "\n" | pecl install msgpack 346 | docker-php-ext-enable msgpack 347 | fi 348 | 349 | if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then 350 | echo "---------- Install igbinary ----------" 351 | printf "\n" | pecl install igbinary 352 | docker-php-ext-enable igbinary 353 | fi 354 | 355 | 356 | if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then 357 | echo "---------- Install yac ----------" 358 | printf "\n" | pecl install yac-2.0.2 359 | docker-php-ext-enable yac 360 | fi 361 | 362 | if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then 363 | isPhpVersionGreaterOrEqual 7 0 364 | if [[ "$?" = "1" ]]; then 365 | echo "---------- Install yar ----------" 366 | printf "\n" | pecl install yar 367 | docker-php-ext-enable yar 368 | else 369 | echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" 370 | fi 371 | 372 | fi 373 | 374 | 375 | if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then 376 | echo "---------- Install yaconf ----------" 377 | printf "\n" | pecl install yaconf 378 | docker-php-ext-enable yaconf 379 | fi 380 | 381 | if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then 382 | echo "---------- Install seaslog ----------" 383 | printf "\n" | pecl install seaslog 384 | docker-php-ext-enable seaslog 385 | fi 386 | 387 | if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then 388 | echo "---------- Install varnish ----------" 389 | apk add --no-cache varnish-dev 390 | printf "\n" | pecl install varnish 391 | docker-php-ext-enable varnish 392 | fi 393 | 394 | if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then 395 | isPhpVersionGreaterOrEqual 7 1 396 | if [[ "$?" = "1" ]]; then 397 | echo "---------- Install pdo_sqlsrv ----------" 398 | apk add --no-cache unixodbc-dev 399 | printf "\n" | pecl install pdo_sqlsrv 400 | docker-php-ext-enable pdo_sqlsrv 401 | else 402 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 403 | fi 404 | fi 405 | 406 | if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then 407 | isPhpVersionGreaterOrEqual 7 1 408 | if [[ "$?" = "1" ]]; then 409 | echo "---------- Install sqlsrv ----------" 410 | apk add --no-cache unixodbc-dev 411 | printf "\n" | pecl install sqlsrv 412 | docker-php-ext-enable sqlsrv 413 | else 414 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 415 | fi 416 | fi 417 | 418 | if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then 419 | isPhpVersionGreaterOrEqual 7 2 420 | if [[ "$?" = "1" ]]; then 421 | echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------" 422 | else 423 | echo "---------- Install mcrypt ----------" 424 | apk add --no-cache libmcrypt-dev \ 425 | && docker-php-ext-install ${MC} mcrypt 426 | fi 427 | fi 428 | 429 | if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then 430 | isPhpVersionGreaterOrEqual 7 0 431 | 432 | if [[ "$?" = "1" ]]; then 433 | echo "---------- mysql was REMOVED from PHP 7.0.0 ----------" 434 | else 435 | echo "---------- Install mysql ----------" 436 | docker-php-ext-install ${MC} mysql 437 | fi 438 | fi 439 | 440 | if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then 441 | isPhpVersionGreaterOrEqual 7 2 442 | if [[ "$?" = "1" ]]; then 443 | echo 444 | echo "Sodium is bundled with PHP from PHP 7.2.0" 445 | echo 446 | else 447 | echo "---------- Install sodium ----------" 448 | apk add --no-cache libsodium-dev 449 | docker-php-ext-install ${MC} sodium 450 | fi 451 | fi 452 | 453 | if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then 454 | echo "---------- Install amqp ----------" 455 | apk add --no-cache rabbitmq-c-dev 456 | installExtensionFromTgz amqp-1.9.4 457 | fi 458 | 459 | if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then 460 | echo "---------- Install redis ----------" 461 | isPhpVersionGreaterOrEqual 7 0 462 | if [[ "$?" = "1" ]]; then 463 | installExtensionFromTgz redis-5.0.2 464 | else 465 | printf "\n" | pecl install redis-4.3.0 466 | docker-php-ext-enable redis 467 | fi 468 | fi 469 | 470 | if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then 471 | echo "---------- Install apcu ----------" 472 | installExtensionFromTgz apcu-5.1.17 473 | fi 474 | 475 | if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then 476 | echo "---------- Install memcached ----------" 477 | apk add --no-cache libmemcached-dev zlib-dev 478 | isPhpVersionGreaterOrEqual 7 0 479 | 480 | if [[ "$?" = "1" ]]; then 481 | printf "\n" | pecl install memcached-3.1.3 482 | else 483 | printf "\n" | pecl install memcached-2.2.0 484 | fi 485 | 486 | docker-php-ext-enable memcached 487 | fi 488 | 489 | if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then 490 | echo "---------- Install memcache ----------" 491 | isPhpVersionGreaterOrEqual 7 0 492 | if [[ "$?" = "1" ]]; then 493 | installExtensionFromTgz memcache-4.0.5.2 494 | else 495 | installExtensionFromTgz memcache-2.2.6 496 | fi 497 | fi 498 | 499 | if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then 500 | echo "---------- Install xdebug ----------" 501 | isPhpVersionGreaterOrEqual 7 0 502 | 503 | if [[ "$?" = "1" ]]; then 504 | isPhpVersionGreaterOrEqual 7 4 505 | if [[ "$?" = "1" ]]; then 506 | installExtensionFromTgz xdebug-2.9.2 507 | else 508 | installExtensionFromTgz xdebug-2.6.1 509 | fi 510 | else 511 | installExtensionFromTgz xdebug-2.5.5 512 | fi 513 | fi 514 | 515 | if [[ -z "${EXTENSIONS##*,event,*}" ]]; then 516 | echo "---------- Install event ----------" 517 | apk add --no-cache libevent-dev 518 | export is_sockets_installed=$(php -r "echo extension_loaded('sockets');") 519 | 520 | if [[ "${is_sockets_installed}" = "" ]]; then 521 | echo "---------- event is depend on sockets, install sockets first ----------" 522 | docker-php-ext-install sockets 523 | fi 524 | 525 | echo "---------- Install event again ----------" 526 | installExtensionFromTgz event-2.5.3 "--ini-name event.ini" 527 | fi 528 | 529 | if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then 530 | echo "---------- Install mongodb ----------" 531 | installExtensionFromTgz mongodb-1.5.5 532 | fi 533 | 534 | if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then 535 | echo "---------- Install yaf ----------" 536 | isPhpVersionGreaterOrEqual 7 0 537 | 538 | if [[ "$?" = "1" ]]; then 539 | printf "\n" | pecl install yaf 540 | docker-php-ext-enable yaf 541 | else 542 | installExtensionFromTgz yaf-2.3.5 543 | fi 544 | fi 545 | 546 | 547 | if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then 548 | echo "---------- Install swoole ----------" 549 | isPhpVersionGreaterOrEqual 7 0 550 | 551 | if [[ "$?" = "1" ]]; then 552 | installExtensionFromTgz swoole-4.4.2 553 | else 554 | installExtensionFromTgz swoole-2.0.11 555 | fi 556 | fi 557 | 558 | if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then 559 | echo "---------- Install zip ----------" 560 | # Fix: https://github.com/docker-library/php/issues/797 561 | apk add --no-cache libzip-dev 562 | 563 | isPhpVersionGreaterOrEqual 7 4 564 | if [[ "$?" != "1" ]]; then 565 | docker-php-ext-configure zip --with-libzip=/usr/include 566 | fi 567 | 568 | docker-php-ext-install ${MC} zip 569 | fi 570 | 571 | if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then 572 | echo "---------- Install XHProf ----------" 573 | 574 | isPhpVersionGreaterOrEqual 7 0 575 | 576 | if [[ "$?" = "1" ]]; then 577 | mkdir xhprof \ 578 | && tar -xf xhprof-2.1.0.tgz -C xhprof --strip-components=1 \ 579 | && ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \ 580 | && docker-php-ext-enable xhprof 581 | else 582 | echo "---------- PHP Version>= 7.0----------" 583 | fi 584 | 585 | fi 586 | 587 | if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then 588 | echo "---------- Install xlswriter ----------" 589 | isPhpVersionGreaterOrEqual 7 0 590 | 591 | if [[ "$?" = "1" ]]; then 592 | printf "\n" | pecl install xlswriter 593 | docker-php-ext-enable xlswriter 594 | else 595 | echo "---------- PHP Version>= 7.0----------" 596 | fi 597 | fi 598 | 599 | if [ "${PHP_EXTENSIONS}" != "" ]; then 600 | apk del .build-deps \ 601 | && docker-php-source delete 602 | fi 603 | -------------------------------------------------------------------------------- /services/php73/extensions/memcache-2.2.6.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/memcache-2.2.6.tgz -------------------------------------------------------------------------------- /services/php73/extensions/memcache-4.0.5.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/memcache-4.0.5.2.tgz -------------------------------------------------------------------------------- /services/php73/extensions/mongodb-1.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/mongodb-1.5.5.tgz -------------------------------------------------------------------------------- /services/php73/extensions/redis-5.0.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/redis-5.0.2.tgz -------------------------------------------------------------------------------- /services/php73/extensions/swoole-2.0.11.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/swoole-2.0.11.tgz -------------------------------------------------------------------------------- /services/php73/extensions/swoole-4.4.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/swoole-4.4.2.tgz -------------------------------------------------------------------------------- /services/php73/extensions/xdebug-2.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/xdebug-2.5.5.tgz -------------------------------------------------------------------------------- /services/php73/extensions/xdebug-2.6.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/xdebug-2.6.1.tgz -------------------------------------------------------------------------------- /services/php73/extensions/xdebug-2.9.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/xdebug-2.9.2.tgz -------------------------------------------------------------------------------- /services/php73/extensions/xhprof-2.1.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/xhprof-2.1.0.tgz -------------------------------------------------------------------------------- /services/php73/extensions/yaf-2.3.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php73/extensions/yaf-2.3.5.tgz -------------------------------------------------------------------------------- /services/php73/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 10 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | slowlog = /var/log/php/fpm.slow.log 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | request_slowlog_timeout = 3 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | catch_workers_output = yes 373 | 374 | ; Clear environment in FPM workers 375 | ; Prevents arbitrary environment variables from reaching FPM worker processes 376 | ; by clearing the environment in workers before env vars specified in this 377 | ; pool configuration are added. 378 | ; Setting to "no" will make all environment variables available to PHP code 379 | ; via getenv(), $_ENV and $_SERVER. 380 | ; Default Value: yes 381 | ;clear_env = no 382 | 383 | ; Limits the extensions of the main script FPM will allow to parse. This can 384 | ; prevent configuration mistakes on the web server side. You should only limit 385 | ; FPM to .php extensions to prevent malicious users to use other extensions to 386 | ; execute php code. 387 | ; Note: set an empty value to allow all extensions. 388 | ; Default Value: .php 389 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 390 | 391 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 392 | ; the current environment. 393 | ; Default Value: clean env 394 | ;env[HOSTNAME] = $HOSTNAME 395 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 396 | ;env[TMP] = /tmp 397 | ;env[TMPDIR] = /tmp 398 | ;env[TEMP] = /tmp 399 | 400 | ; Additional php.ini defines, specific to this pool of workers. These settings 401 | ; overwrite the values previously defined in the php.ini. The directives are the 402 | ; same as the PHP SAPI: 403 | ; php_value/php_flag - you can set classic ini defines which can 404 | ; be overwritten from PHP call 'ini_set'. 405 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 406 | ; PHP call 'ini_set' 407 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 408 | 409 | ; Defining 'extension' will load the corresponding shared extension from 410 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 411 | ; overwrite previously defined php.ini values, but will append the new value 412 | ; instead. 413 | 414 | ; Note: path INI options can be relative and will be expanded with the prefix 415 | ; (pool, global or /usr/local) 416 | 417 | ; Default Value: nothing is defined by default except the values in php.ini and 418 | ; specified at startup with the -d argument 419 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 420 | ;php_flag[display_errors] = off 421 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 422 | ;php_admin_flag[log_errors] = on 423 | ;php_admin_value[memory_limit] = 32M 424 | -------------------------------------------------------------------------------- /services/php8/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION 2 | FROM ${PHP_VERSION} 3 | 4 | ARG TZ 5 | ARG PHP_EXTENSIONS 6 | ARG CONTAINER_PACKAGE_URL 7 | 8 | 9 | RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi 10 | 11 | COPY ./extensions /tmp/extensions 12 | WORKDIR /tmp/extensions 13 | RUN chmod +x install.sh \ 14 | && sh install.sh \ 15 | && rm -rf /tmp/extensions 16 | 17 | ADD ./extensions/install-php-extensions /usr/local/bin/ 18 | 19 | RUN chmod uga+x /usr/local/bin/install-php-extensions 20 | 21 | RUN apk --no-cache add tzdata \ 22 | && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ 23 | && echo "$TZ" > /etc/timezone 24 | 25 | 26 | # Fix: https://github.com/docker-library/php/issues/240 27 | RUN apk add gnu-libiconv libstdc++ --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/community/ --allow-untrusted 28 | ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php 29 | 30 | 31 | # Install composer and change it's cache home 32 | RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ 33 | && chmod +x /usr/bin/composer 34 | ENV COMPOSER_HOME=/tmp/composer 35 | 36 | # php image's www-data user uid & gid are 82, change them to 1000 (primary user) 37 | RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data 38 | 39 | 40 | WORKDIR /www 41 | -------------------------------------------------------------------------------- /services/php8/extensions/event-3.0.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siyecoo/docker-php/a2a2108720171b617974eaec132902aba6f57a3f/services/php8/extensions/event-3.0.5.tgz -------------------------------------------------------------------------------- /services/phpmyadmin/config.inc.php: -------------------------------------------------------------------------------- 1 | > config.inc.php 5 | 6 | # 编辑 config.inc.php 7 | # 查找 $cfg['Servers'][$i]['AllowNoPassword'] 行 8 | # 并添加以下行,ruser 替换自己的只读用户 9 | 10 | # $i = 1; 11 | # $cfg['Servers'][$i]['AllowRoot'] = false; 12 | # $cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit'; 13 | # $cfg['Servers'][$i]['AllowDeny']['rules'] = ['allow ruser from all']; -------------------------------------------------------------------------------- /services/phpmyadmin/php-phpmyadmin.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | allow_url_fopen = Off 3 | max_execution_time = 600 4 | memory_limit = 1024M 5 | open_basedir = /var/www:/tmp/:/etc/phpmyadmin/ 6 | post_max_size = 512M 7 | upload_max_filesize = 512M 8 | 9 | [Session] 10 | session.cookie_httponly = 1 11 | session.hash_function = 1 12 | session.save_path = "/tmp" 13 | session.use_strict_mode = 1 14 | 15 | [opcache] 16 | opcache.fast_shutdown = 1 17 | opcache.restrict_api = /disabled/ 18 | opcache.save_comments = 0 19 | opcache.use_cwd = 0 20 | opcache.validate_timestamps = 0 21 | -------------------------------------------------------------------------------- /services/rabbitmq/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG RABBITMQ_VERSION 2 | FROM rabbitmq:${RABBITMQ_VERSION} 3 | 4 | ARG RABBITMQ_VERSION 5 | ARG RABBITMQ_PLUGINS 6 | -------------------------------------------------------------------------------- /services/supervisor/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ALPINE_VERSION 2 | FROM ${ALPINE_VERSION} 3 | ARG TZ 4 | ARG CONTAINER_PACKAGE_URL 5 | 6 | 7 | RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories 8 | 9 | RUN apk update \ 10 | && apk upgrade \ 11 | && apk add supervisor \ 12 | && apk --no-cache add tzdata \ 13 | && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ 14 | && echo "$TZ" > /etc/timezone \ 15 | && rm -rf /var/cache/apk/* 16 | 17 | 18 | WORKDIR /www -------------------------------------------------------------------------------- /services/supervisor/conf.d/php-fpm.ini: -------------------------------------------------------------------------------- 1 | [program:php] 2 | command=php -m 3 | ;directory=/www/localhost/ 4 | priority=999 ; the relative start priority (default 999) 5 | autostart=true ; start at supervisord start (default: true) 6 | autorestart=true ; retstart at unexpected quit (default: true) 7 | startsecs=10 ; number of secs prog must stay running (def. 10) 8 | startretries=3 ; max # of serial start failures (default 3) 9 | exitcodes=0,2 ; 'expected' exit codes for process (default 0,2) 10 | stopsignal=QUIT ; signal used to kill process (default TERM) 11 | stopwaitsecs=10 ; max num secs to wait before SIGKILL (default 10) 12 | user=root ; setuid to this UNIX account to run the program 13 | log_stdout=true 14 | log_stderr=true ; if true, log program stderr (def false) 15 | logfile=/var/log/supervisor/php.log 16 | logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 17 | logfile_backups=10 ; # of logfile backups (default 10) 18 | stdout_logfile_maxbytes=20MB ; stdout 日志文件大小,默认 50MB 19 | stdout_logfile_backups=20 ; stdout 日志文件备份数 20 | stdout_logfile=/var/log/supervisor/php.stdout.log 21 | -------------------------------------------------------------------------------- /services/supervisor/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/run/supervisord.sock ; (the path to the socket file) 3 | ;chmod=0700 ; socked file mode (default 0700) 4 | ;chown=nobody:nogroup ; socket file uid:gid owner 5 | ;username=user ; (default is no username (open server)) 6 | ;password=123 ; (default is no password (open server)) 7 | 8 | [inet_http_server] ; inet (TCP) server disabled by default 9 | port=0.0.0.0:9001 ; (ip_address:port specifier, *:port for all iface) 10 | username=user ; (default is no username (open server)) 11 | password=123 ; (default is no password (open server)) 12 | 13 | [supervisord] 14 | logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) 15 | ;logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 16 | ;logfile_backups=10 ; (num of main logfile rotation backups;default 10) 17 | loglevel=error ; (log level;default info; others: debug,warn,trace) 18 | pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 19 | nodaemon=true ; (start in foreground if true;default false) 20 | ;minfds=1024 ; (min. avail startup file descriptors;default 1024) 21 | ;minprocs=200 ; (min. avail process descriptors;default 200) 22 | ;umask=022 ; (process file creation umask;default 022) 23 | user=root ; (default is current user, required if root) 24 | ;identifier=supervisor ; (supervisord identifier, default is 'supervisor') 25 | ;directory=/tmp ; (default is not to cd during start) 26 | ;nocleanup=true ; (don't clean up tempfiles at start;default false) 27 | ;childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) 28 | ;environment=KEY=value ; (key value pairs to add to environment) 29 | ;strip_ansi=false ; (strip ansi escape codes in logs; def. false) 30 | 31 | ; the below section must remain in the config file for RPC 32 | ; (supervisorctl/web interface) to work, additional interfaces may be 33 | ; added by defining them in separate rpcinterface: sections 34 | [rpcinterface:supervisor] 35 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 36 | 37 | [supervisorctl] 38 | serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket 39 | ;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket 40 | ;username=chris ; should be same as http_username if set 41 | ;password=123 ; should be same as http_password if set 42 | ;prompt=mysupervisor ; cmd line prompt (default "supervisor") 43 | ;history_file=~/.sc_history ; use readline history if available 44 | 45 | ; The below sample program section shows all possible program subsection values, 46 | ; create one or more 'real' program: sections to be able to control them under 47 | ; supervisor. 48 | 49 | ;[program:theprogramname] 50 | ;command=/bin/cat ; the program (relative uses PATH, can take args) 51 | ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) 52 | ;numprocs=1 ; number of processes copies to start (def 1) 53 | ;directory=/tmp ; directory to cwd to before exec (def no cwd) 54 | ;umask=022 ; umask for process (default None) 55 | ;priority=999 ; the relative start priority (default 999) 56 | ;autostart=true ; start at supervisord start (default: true) 57 | ;autorestart=unexpected ; whether/when to restart (default: unexpected) 58 | ;startsecs=1 ; number of secs prog must stay running (def. 1) 59 | ;startretries=3 ; max # of serial start failures (default 3) 60 | ;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2) 61 | ;stopsignal=QUIT ; signal used to kill process (default TERM) 62 | ;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) 63 | ;killasgroup=false ; SIGKILL the UNIX process group (def false) 64 | ;user=chrism ; setuid to this UNIX account to run the program 65 | ;redirect_stderr=true ; redirect proc stderr to stdout (default false) 66 | ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO 67 | ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 68 | ;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) 69 | ;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 70 | ;stdout_events_enabled=false ; emit events on stdout writes (default false) 71 | ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO 72 | ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 73 | ;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10) 74 | ;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 75 | ;stderr_events_enabled=false ; emit events on stderr writes (default false) 76 | ;environment=A=1,B=2 ; process environment additions (def no adds) 77 | ;serverurl=AUTO ; override serverurl computation (childutils) 78 | 79 | ; The below sample eventlistener section shows all possible 80 | ; eventlistener subsection values, create one or more 'real' 81 | ; eventlistener: sections to be able to handle event notifications 82 | ; sent by supervisor. 83 | 84 | ;[eventlistener:theeventlistenername] 85 | ;command=/bin/eventlistener ; the program (relative uses PATH, can take args) 86 | ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) 87 | ;numprocs=1 ; number of processes copies to start (def 1) 88 | ;events=EVENT ; event notif. types to subscribe to (req'd) 89 | ;buffer_size=10 ; event buffer queue size (default 10) 90 | ;directory=/tmp ; directory to cwd to before exec (def no cwd) 91 | ;umask=022 ; umask for process (default None) 92 | ;priority=-1 ; the relative start priority (default -1) 93 | ;autostart=true ; start at supervisord start (default: true) 94 | ;autorestart=unexpected ; whether/when to restart (default: unexpected) 95 | ;startsecs=1 ; number of secs prog must stay running (def. 1) 96 | ;startretries=3 ; max # of serial start failures (default 3) 97 | ;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2) 98 | ;stopsignal=QUIT ; signal used to kill process (default TERM) 99 | ;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) 100 | ;killasgroup=false ; SIGKILL the UNIX process group (def false) 101 | ;user=chrism ; setuid to this UNIX account to run the program 102 | ;redirect_stderr=true ; redirect proc stderr to stdout (default false) 103 | ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO 104 | ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 105 | ;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) 106 | ;stdout_events_enabled=false ; emit events on stdout writes (default false) 107 | ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO 108 | ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 109 | ;stderr_logfile_backups ; # of stderr logfile backups (default 10) 110 | ;stderr_events_enabled=false ; emit events on stderr writes (default false) 111 | ;environment=A=1,B=2 ; process environment additions 112 | ;serverurl=AUTO ; override serverurl computation (childutils) 113 | 114 | ; The below sample group section shows all possible group values, 115 | ; create one or more 'real' group: sections to create "heterogeneous" 116 | ; process groups. 117 | 118 | ;[group:thegroupname] 119 | ;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions 120 | ;priority=999 ; the relative start priority (default 999) 121 | 122 | ; The [include] section can just contain the "files" setting. This 123 | ; setting can list multiple files (separated by whitespace or 124 | ; newlines). It can also contain wildcards. The filenames are 125 | ; interpreted as relative to this file. Included files *cannot* 126 | ; include files themselves. 127 | 128 | [include] 129 | files = /etc/supervisor/conf.d/*.ini 130 | -------------------------------------------------------------------------------- /www/localhost/index.php: -------------------------------------------------------------------------------- 1 | 欢迎使用 docker siyecoo php!'; 9 | echo '

版本信息

'; 10 | 11 | echo '
    '; 12 | echo '
  • PHP版本:', PHP_VERSION, '
  • '; 13 | echo '
  • Nginx版本:', $_SERVER['SERVER_SOFTWARE'], '
  • '; 14 | echo '
  • MySQL服务器版本:', getMysqlVersion(), '
  • '; 15 | echo '
  • Redis服务器版本:', getRedisVersion(), '
  • '; 16 | echo '
'; 17 | 18 | echo '

已安装扩展

'; 19 | printExtensions(); 20 | 21 | 22 | /** 23 | * 获取MySQL版本 24 | */ 25 | function getMysqlVersion() 26 | { 27 | if (extension_loaded('PDO_MYSQL')) { 28 | try { 29 | $dbh = new PDO('mysql:host=mysql;dbname=mysql', 'root', '123456'); 30 | $sth = $dbh->query('SELECT VERSION() as version'); 31 | $info = $sth->fetch(); 32 | } catch (PDOException $e) { 33 | return $e->getMessage(); 34 | } 35 | return $info['version']; 36 | } else { 37 | return 'PDO_MYSQL 扩展未安装 ×'; 38 | } 39 | 40 | } 41 | 42 | /** 43 | * 获取Redis版本 44 | */ 45 | function getRedisVersion() 46 | { 47 | if (extension_loaded('redis')) { 48 | try { 49 | $redis = new Redis(); 50 | $redis->connect('redis', 6379); 51 | $redis->auth('siyecao'); 52 | $info = $redis->info(); 53 | return $info['redis_version']; 54 | } catch (Exception $e) { 55 | return $e->getMessage(); 56 | } 57 | } else { 58 | return 'Redis 扩展未安装 ×'; 59 | } 60 | } 61 | 62 | /** 63 | * 获取已安装扩展列表 64 | */ 65 | function printExtensions() 66 | { 67 | echo '
    '; 68 | foreach (get_loaded_extensions() as $i => $name) { 69 | echo "
  1. ", $name, '=', phpversion($name), '
  2. '; 70 | } 71 | echo '
'; 72 | } 73 | 74 | --------------------------------------------------------------------------------