docker php-fpm nginx配置
docker镜像php-8.2-fpm的工作目录为:/var/www/html
创建本地目录~/nginx/html,用于保存php网页文件。
创建本地目录~/nginx/conf,用于保存nginx配置文件。
docker run -d --name php -v ~/nginx/html:/var/www/html php-8.2-fpm
将nginx容器配置文件复制到本地
docker run -d --name tmpnginx nginx:latest
docker cp tmpnginx:/etc/nginx/conf.d/. ~/nginx/conf
docker rm tmpnginx -f
docker run -d --name nginx -p 80:80 -v ~/nginx/conf:/etc/nginx/conf.d -v ~/nginx/html:/usr/share/nginx/html --link php nginx:latest
编辑本地nginx配置文件:
评论已关闭