前言 近期需要部署一个PHP项目,但是项目中带有 swoole,不想在服务器安装swoole扩展,想做一个docker镜像,对服务器干净一些,不对当前环境造成影响,所以就有了这个小功能 文件 一共有4个文件和一个目录 目录 1 . ./data/www 说明 PHP文件存放目录 文件 ./data/nginx.conf NGINX 配置文件 ./swoole_loader.so swoole_loader 扩展文件 ./Dockerfile 镜像构建文件 ./docker-compose.yml docker编排文件 ./data/nginx.conf 文件内容 server { listen 80; server_name _; root /var/www/html; index index.php index.html index.htm; # URL重写配置 location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } try_files $uri $uri/ /ind…