php72 redis6.0.8 mysql5.7 nginx
nginx容器
https://blog.csdn.net/BThinker/article/details/123507820
docker run \
-p 80:80 \
--name mynginx \
-v /mydata/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \
-v /mydata/nginx/conf/conf.d:/etc/nginx/conf.d \
-v /mydata/nginx/log:/var/log/nginx \
-v /mydata/nginx/html:/usr/share/nginx/html \
--link myphp72:php --restart=always -d nginx
mysql容器
docker run --name mysql57 -p 3306:3306 -v /mydata/mysql/conf/my.cnf:/etc/my.cnf -v /mydata/mysql/data:/var/lib/mysql -v /mydata/mysql/log:/logs -e MYSQL_ROOT_PASSWORD=123456 --restart=always -d mysql:5.7
php容器
docker run --name myphp72 --restart=always -p 9000:9000 -v /mydata/nginx/html:/usr/share/nginx/html -v /mydata/php/php.ini:/usr/local/etc/php/php.ini -v /mydata/php/php-fpm.conf:/usr/local/etc/php-fpm.conf -v /mydata/php/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf -d registry.cn-hangzhou.aliyuncs.com/antsun/php_env:1.0.2
nginx/conf/conf.d/default.conf
location ~ \.php$ {
#root html;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/$fastcgi_script_name;
include fastcgi_params;
}
参考php扩展安装
https://blog.csdn.net/qq_55096795/article/details/129717294
参考phpGD库 https://blog.csdn.net/longfeng995/article/details/131473101
reids容器
docker run –restart=always -p 6379:6379 –name myredis -v /mydata/redis/data:/data -d redis:6.0.8
发布镜像到阿里云
$ docker pull registry.cn-hangzhou.aliyuncs.com/antsun/php_env:[镜像版本号]
$ docker login --username=aliyun5339502151 registry.cn-hangzhou.aliyuncs.com$ docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/antsun/php_env:[镜像版本号]$ docker push registry.cn-hangzhou.aliyuncs.com/antsun/php_env:[镜像版本号]