下载docker
windows下下载
 安装Windows docker,会提示安装
 
安装wsl
https://docs.microsoft.com/zh-cn/windows/wsl/install(插件)
 安装>wsl --install -d Ubuntu-16.04

 
 用户名:xxx 密码:xxx
supervisor安装
安装 epel 源,如果此前安装过,此步骤跳过
yum install -y epel-release
 yum install -y supervisor
 systemctl enable supervisord # 开机自启动
 systemctl start supervisord # 启动supervisord服务
 systemctl status supervisord # 查看supervisord服务状态
配置hyperf进程管理
在文件结尾处追加以下内容后保存文件
 vim /etc/supervisord.conf
 $/etc/supervisord.d 路径
新建一个应用并设置一个名称,这里设置为 hyperf[program:hyperf]
[program:hyperf]
 #路径
 directory=/www/wwwroot/demo/
 #命令
 command=/usr/bin/php /www/wwwroot/demo/bin/hyperf.php start
 ##以哪个用户来运行该进程
 user=root# supervisor 启动时自动该应用
 autostart=true
 autorestart=true# 进程退出后自动重启进程
 startsecs=1# 进程持续运行多久才认为是启动成功
 startretries=3# 重试次数
 stderr_logfile=/var/www/hyperf/runtime/stderr.log# stderr 日志输出位置
stdout_logfile=/var/www/hyperf/runtime/stdout.log# stdout 日志输出位置
重启supervisord,使其生效
systemctl restart supervisord## supervisorctl 管理命令
 supervisorctl start hyperf# 启动 hyperf 应用
supervisorctl restart hyperf# 重启 hyperf 应用
supervisorctl stop hyperf # 停止 hyperf 应用
supervisorctl status# 查看所有被管理项目运行状态
supervisorctl update# 重新加载配置文件
supervisorctl reload# 重新启动所有程序
启动项目
在$/home/demo
 $ php bin/hyperf.php start