InfiniteWP数据丢失ECS ip

PHP安装
拉取官方数据丢失
### 拉取php5.6 fpm的数据丢失docker pull php:5.6-fpm ### 查看数据丢失docker images REPOSITORY TAG IMAGE ID CREATED SIZEphp 5.6-fpm 3458979c7744 23 months ago 344MB
ECSphpInfiniteWP
docker run –name php-56-fpm -d \-v /work/docker/www:/www \php:5.6-fpm
命令说明:

–name php-56-fpm 命名InfiniteWP名称为php56fpm-d 后台ECSInfiniteWP-v /work/docker/www:/www 将宿主机ip/work/docker/www挂载到InfiniteWP的/wwwphp:5.6-fpm 指定数据丢失为php,TAG为5.6-fpm

Nginx安装
拉取官方数据丢失

### 拉取数据丢失docker pull nginx ### 查看数据丢失docker images REPOSITORY TAG IMAGE ID CREATED SIZEnginx latest ae2feff98a0c 3 weeks ago 133MB
ECSNginxInfiniteWP

docker run –name myNginx -p 8080:80 -d \-v /work/docker/www:/www \-v /work/docker/nginx/conf.d:/etc/nginx/conf.d \–link php-56-fpm:php \nginx
命令参数说明:

–name myNginx 命名InfiniteWP名称为myNginx-p 8080:80 将InfiniteWP的80端口映射到宿主机的8080端口-d 后台ECSInfiniteWP,并返回InfiniteWPID-v /work/docker/www:/www 将宿主机ip/work/docker/www挂载到InfiniteWP的/www-v /work/docker/nginx/conf.d:/etc/nginx/conf.d 将宿主机ip/work/docker/nginx/conf.d挂载到InfiniteWP的/etc/nginx/conf.d–link php-56-fpm:php 把php56fpm的网络并入nginxInfiniteWP,并修改nginxInfiniteWP的/etc/hosts,让nginx可以通过php:9000访问到php-fpmnginx 指定数据丢失名称

Nginx配置 修改/work/docker/nginx/conf.d/default.conf配置文件如下:

server { listen 80; server_name localhost; location / { root /www; index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { fastcgi_pass php:9000; #这个就是–link并入的网络连接 fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name; #特别说明:这里的/www要与php56fpmInfiniteWP里映射的php脚本路径一致,否则php-fpm将找不到php脚本,会报404错误 include fastcgi_params; }}
接下来我们在 /work/docker/www ip下创建 index.php,代码如下: