member-doc/deploy.md
2022-08-23 11:53:06 +08:00

109 lines
9.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 基础知识
学习部署之前你需要了解公司k8s和docker以及ci知识以及星云基座和伙伴应用知识如果不了解请先阅读下面知识链接
1. [PHP 项目适配K8S改造步骤](http://huoban.aihoge.com/question/detail/5)
2. [服务容器自动化功能与设计](http://huoban.aihoge.com/question/detail/18)
3. [星云伙伴应用业务应用使用说明](http://huoban.aihoge.com/question/detail/1)
4. [星云基座使用说明](http://huoban.aihoge.com/question/detail/30?source=home&activeTab=%E4%BC%99%E4%BC%B4%2F%E5%9F%BA%E5%BA%A7%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&key=)
## 部署配置
整个会员服务部署配置集中在项目.env文件中了解env文件就基本了解会员大部分部署配置。
会员服务还附带一个基于百度amis低代码搭建的web前端界面这边要求使用者需要带有前端基础知识或有关搭建经验[amis文档参考](https://aisuda.bce.baidu.com/amis/zh-CN/docs/index)。
下面基于目前最新版部署进行讲解:
### 会员中心后端配置
git地址https://git.hoge.cn/os-yun/mermber-center.git
```shell
#基础配置
APP_NAME=member-center //应用名称 默认member-center 不建议修改
APP_SERVICE_NAME=member-center //服务名称 默认member-center 不建议修改
APP_ENV=${{会员中心开发环境}} //online环境部署应该填写pro 非online 填写dev
#mysql 这些配置是根据星云基座部署生成,建议部署完之后检查该项目是否正确
DB_DRIVER=mysql
DB_HOST=mysql8.base
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=yun_
#redis 这些配置是根据星云基座部署生成,建议部署完之后检查该项目是否正确
REDIS_HOST=redis.base
REDIS_PASSWORD=hogesoft:9fsAh8ZZ1a
REDIS_PORT=6379
SELECT=15
#jwt 配置默认不需要改动如需改动需要开发者熟悉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n1aCzVfAObAO2/lJvv\nSrJXbPlJk/s4rif7rb3gdaECAwEAAQ==\n-----END PUBLIC KEY-----\n"
JWT_PASSPHRASE="D6+tnq4pdCa4OEwAKJ5cTg=="
#RabbitMQ 该配置是根据星云基座部署生成,建议部署完之后检查该项目是否正确
RABBITMQ_HOST=
RABBITMQ_PORT=5672
RABBITMQ_USER=
RABBITMQ_PASSWORD=
#MONGODB 该配置是根据星云基座部署生成,建议部署完之后检查该项目是否正确
MONGODB_USERNAME=
MONGODB_PASSWORD=
MONGODB_HOST=mysql8.base
MONGODB_PORT=27017
MONGODB_DB=null 默认admin 数据库
MONGO_DATABASE_PREFIX=DB //DB 前缀默认不需要变动,如需变动请根据自动星云基座部署生成MONGODB_* 中 `*` 是否匹配 比如该列中MONGODB_DB 则对应`DB`
#oss 该配置自2.0.1.40以后版本可以废弃该配置该配置默认配置阿里云oss。新版安装在伙伴授权中不用考虑该配置但需要安装星云oss
OSS_ACCESS_ID=${{OSS_ACCESS_ID}}
OSS_ACCESS_SECRET=${{OSS_ACCESS_SECRET}}
OSS_BUCKET=${{OSS_BUCKET}}
OSS_ENDPOINT=${{OSS_ENDPOINT}}
```
#### 部署完之后需要检查事项
1. 会员部署之后需要检查一下 mysql mongodb 以及redis 配置是否正常自动生成
2. 根据配置后端api地址 请求一下 是否有异常抛出,比如地址为 http://member.xx.com 正常返回空白或返回json error_code == 0 正确的
3. 会员其他配置如sns 短信,授权 均在低代码【配置管理】中进行配置
#### 关于云服务或plus需要提供授权配置
在低代码【配置管理】-【会员授权】中进行配置没有的话可以新增一个建议新增一个。需要id service_key service_access_secret 都在这边维护。
### 会员中心前端amis配置
git地址https://git.hoge.cn/zhouyangyang/member-center-web.git
```shell
API_HOST=http://${{会员中心后端接口域名}} //该配置会员后端域名配置http还是https 根据实际情况
APP_SERVICE_NAME=member-center-web-amis // 服务名称 默认 无需修改
#积分字段别名
INTEGRAL_ALIAS=积分 //默认无需修改,修改该字段会导致页面所有积分文本显示该字段配置数值以满足将积分替换任意文本
```
#### 在桌面生成应用图标配置
参考链接https://help.aihoge.com/web/#/19?page_id=105 有疑问可以联系周捷
## 星云oss 配置
星云oss安装相关问题可以直接找李成。在会员服务 config/autoload/mmds_oss.php 文件中,如有需要更改请根据实际部署配置相关进行变更否则按照默认配置。
```php
return [
'xy_oss_service_name' => env('XY_OSS_SERVICE', 'mmds'), // 自定义oss_service_name
'xy_oss_group_name' => env('XY_OSS_GROUP', 'mmds-hoge'), 自定义oss 分组
'xy_oss_url' => env('XY_OSS_URL', 'https://static-mmds.aihoge.com'),// 自定义oss 域名
'xy_oss_bucket_name' => env('XY_OOS_BUCKET_NAME', 'mmdsstatic')/ 自定义oss BUCKET_NAME
];
```