docker-PHP
启动指定版本的php容器

docker run -it --rm --name zhimiao_test \
-p 9000:9000 \
-v /usr/share/nginx/html/:/var/www/html/ \
-d php:7.3.0-fpm

查看容器ip

docker inspect --format='{{.NetworkSettings.IPAddress}}' zhimiao_test

nginx中映射的话,最好走端口,免得Ip变来变去然后各种502

server {
listen 1318;
root /usr/share/nginx/html;
location / {
index index.html index.htm index.php;
autoindex off;
}
location ~ \.php(.*)$ {
root /var/www/html/;
fastcgi_pass 127.0.0.1:9003;
fastcgi_index index.php;
fastcgi_split_path_info^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED$document_root$fastcgi_path_info;
includefastcgi_params;
}
}

作者:倒霉狐狸

标签:

创建时间: 2018-12-20 16:17 最后更新时间:2018-12-20 16:19

苏ICP备15039362号 © 2015 纸喵软件 EverNote