wp-php84
Multi-platform PHP-FPM 8.4+ for WordPress on Alpine
1.2K
超轻量 PHP 8.4-FPM 镜像,专为 WordPress 及现代化 PHP 应用优化。
基于 Alpine Linux,多平台构建,体积 < 30 MB,启动秒级完成。
php-mysqliphp-gd, php-imagickphp-curl, php-zip, php-domphp-sodium, php-opcache来自
wordpress.org的建议:
- wordpres 6.8.x 建议使用 micrograils/wp-php82 +
- wordpres 6.9.x 建议使用 micrograils/wp-php83 +
- wordpres 7.x 建议使用 micrograils/wp-php84 +
全部启用模块一览:
# php -m
[PHP Modules]
bcmath, Core, ctype, curl, date, dom, exif, fileinfo, filter, gd, hash, iconv, imagick, json, libxml, mbstring, mysqlnd, openssl, pcre, Phar, random, readline, Reflection, SimpleXML, sodium, SPL, standard, tokenizer, xml, xmlreader, xmlwriter, Zend OPcache, zip, zlib
[Zend Modules]
Zend OPcache
默认调优:
; php.ini
upload_max_filesize = 2M --> 10M
post_max_size = 8M --> 64M
memory_limit = 128M --> 256M
max_execution_time = 30 --> 300
docker run -d --name php \
-v $PWD/html:/var/www/html \
micrograils/wp-php84:latest
docker exec -it php sh
# 容器内
php -v
php-fpm -t
services:
web:
image: micrograils/wp-nginx:latest
ports:
- "80:80"
volumes:
- ./wordpress:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- wp-net
php:
image: micrograils/wp-php84:latest
volumes:
- ./wordpress:/var/www/html
networks:
- wp-net
networks:
wp-net:
示例 nginx.conf 片段:
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
include fastcgi_params;
}
浏览器访问 http://localhost 即可进入 WordPress 安装流程。
挂载本地 php.ini:
docker run -d \
-v $PWD/php.ini:/etc/php84/php.ini:ro \
-v $PWD/www.conf:/etc/php84/php-fpm.d/www.conf:ro \
-v $PWD/site:/var/www/html \
micrograils/wp-php84:latest
| 项目 | 说明 |
|---|---|
| 暴露端口 | 9000/TCP (FastCGI) |
| 工作目录 | /var/www/html |
| 主配置文件 | /etc/php84/php.ini |
| FPM 池配置 | /etc/php84/php-fpm.d/www.conf |
Q:容器内缺少某个扩展?
A:基于 Alpine 官方包,可 apk add php84-<ext> 临时安装;或自行在 Dockerfile 追加后重新构建。
Q:想使用 Alpine 其他版本?
A:构建时指定 ALPINE_VERSION 参数:
docker build --build-arg ALPINE_VERSION=3.22.2 \
-t micrograils/wp-php84:latest .
Gitee 仓库
欢迎提 Issue / PR,一起让 PHP 环境更轻更快!
micrograils/wp-php84
轻到飞起,快若闪电。
Content type
Image
Digest
sha256:5aedf0f7e…
Size
30.8 MB
Last updated
9 days ago
docker pull micrograils/wp-php84