kriss/yii2-advanced

Yii2 高级项目模板,API 前端和带有 AdminLTE 的后端

安装: 61

依赖项: 0

建议者: 0

安全: 0

星标: 5

关注者: 2

分支: 1

公开问题: 5

类型:项目

v1.2 2018-12-04 06:55 UTC

README

新建项目

git clone https://github.com/krissss/yii2advanced xxx
# or
composer create-project kriss/yii2-advanced xxx

开发

# 安装依赖
composer install
yarn
# 初始化环境(dev)
php init
# 数据库迁移
php yii migrate
# 数据初始化
php yii init/init-data
# 权限初始化
php yii init-auth/restore
# 启动 php
composer serve
# 启动 vue
yarn serve

正式部署

# 安装依赖
composer install --no-dev
yarn
# 初始化环境(prod)
php init
# 数据库迁移
php yii migrate
# 数据初始化
php yii init/init-data
# 权限初始化
php yii init-auth/restore
# 配置 nginx 访问 php
# 编译前端
yarn build

使用 docker-compose

php init --env=dev --overwrite=all
# modify .env and docker-compose.yml
docker-compose up
docker-compose exec app composer install -vvv
docker-compose exec app php yii migrate
docker-compose exec app php yii init/init-data
docker-compose exec app php yii init-auth/restore
docker-compose exec app bash