服务端口:9000
- 查看容器:
$ docker container ls
- 进入容器:
docker exec -it dapps-php-7-2-21 /bin/bash # 查看信息 php -v
- 安装nginx应用
- 文件目录为:./dapps/docker/www
- nginx相关配置举例
server { listen 80; charset utf-8; server_name 192.168.10.11 local.com; root /data/www/test/shop/public; index index.html index.htm index.php index.shtml; if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?s=/$1 last; break; } location ~ \.php$ { # docker root /var/www/html/test/shop/public; fastcgi_pass 本机ip:9000; # 或者:127.0.0.1:9000 或者:php-7-2-21:9000 或者:dapps-php-7-2-21:9000 #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; } }