vagrant 开发环境配置
1 安装vagrant
1.1 下载vagrant

1.2 安装



路径根据你自己的喜好选择

2 安装 virtualbox
2.1 下载virtualbox
下载地址:https://download.virtualbox.org/virtualbox/6.1.14/VirtualBox-6.1.14-140239-Win.exe
2.2 安装virtualbox
一步一步安装即可



3 下载开发代码
3.1 加入开发组
通过邀请链接进行注册,因为邀请链接会过期,做到这一步的时候问我要链接
3.2 配置ssh公钥
3.3 git clone 代码
https://thoughts.aliyun.com/sharespace/5e8c37eb546fd9001aee8242/folders/5e8c37ea546fd9001aee8231
4 环境搭建
4.1 下载box
我下载后放下下图路径

4.2 添加box
在vagrant 安装目录 按住shift ,然后右击鼠标(因为vagrant没加入环境变量,你可以将它加入环境变量中就不会这么麻烦)



4.3 启动环境
4.3.1 初始化
新建虚机存放路径(c:\vagrant\yfy)

运行命令 c:\HashiCorp\Vagrant\bin\vagrant.exe init yfy

运行成功后虚机目录下会多出一个配置文件

4.3.2 更改配置文件
在 vagrantfile 中添加以下配置

4.3.3 启动
命令:c:\HashiCorp\Vagrant\bin\vagrant.exe up

4.3.4 常用命令
启动 c:\HashiCorp\Vagrant\bin\vagrant.exe up
关闭 c:\HashiCorp\Vagrant\bin\vagrant.exe halt
5 环境访问
后台访问地址:http://192.168.33.88:81/admin
前台访问地址:http://192.168.33.88
6 npm命令
前台静态文件编译监听:npm run development -- --watch --env.admin
后台静态文件编译监听:npm run development -- --watch
7 前端资源代码路径
后台:resources/vue/admin
前台:resources/vue/web
评论