You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.9 KiB
51 lines
1.9 KiB
2 years ago
|
# 开发和部署方式
|
||
|
|
||
|
## windows x64 下本地开发
|
||
|
|
||
|
当前项目基于 .net 6 sdk,安装 visual studio 2022 时通常会自带
|
||
|
|
||
|
### supervisor 方式开发
|
||
|
|
||
|
1. 根据项目需求,安装 SQL Server 或 MySQL
|
||
|
2. 使用 build/src/win-x64/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理非数据库依赖
|
||
|
|
||
|
配置文件:
|
||
|
|
||
|
1. supervisor: `build\src\win-x64\publish\supervisord\supervisor.dev.conf`
|
||
|
1. nginx: `build\src\win-x64\publish\nginx\conf\nginx.conf`
|
||
|
1. gateway: `build\src\win-x64\publish\gateway\appsettings.json`
|
||
|
1. config: `build\src\win-x64\publish\gateway\wwwroot\settings\appsettings.json`
|
||
|
1. config: `build\src\win-x64\publish\gateway\wwwroot\settings\appsettings.Development.json`
|
||
|
|
||
|
```mermaid
|
||
|
flowchart LR
|
||
|
nginx --localhost:21093--> gateway--localhost:59092--> api:59092
|
||
|
api:59092 --localhost:6379--> redis:6379
|
||
|
api:59092 --localhost:13319--> database:13319
|
||
|
gateway --localhost:8086--> influxdb:8086
|
||
|
```
|
||
|
|
||
|
### Docker Desktop 方式开发
|
||
|
|
||
|
1. 无需按照数据库
|
||
|
2. 使用 build/src/docker/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理依赖
|
||
|
|
||
|
## 部署
|
||
|
|
||
|
### windows x64 supervisor 方式部署
|
||
|
|
||
|
1. 执行: `build\src\win-x64\build.cmd`
|
||
|
2. 上传: `build\dist\win-x64\publish` 目录到服务器
|
||
|
3. 修改配置,执行 publish 目录下的 start.cmd
|
||
|
|
||
|
### docker compose 方式部署
|
||
|
|
||
|
1. 还行: `build\src\docker\build.cmd`
|
||
|
2. 上传: `build\dist\win-x64\publish` 目录到服务器
|
||
|
3. 修改配置,执行 publish 目录下的 start.sh 或 start.cmd
|
||
|
|
||
|
构建时的处理:
|
||
|
|
||
|
1. 复制并重命名 build\src\win-x64\publish\nginx\conf 到 build\dist\docker\publish\conf\nginx,保持nginx的配置文件统一在 build\src\win-x64\publish\nginx\conf 目录维护
|
||
|
1. 复制 build\src\win-x64\publish\gateway 到 build\dist\docker\publish\gateway,保持网关的配置和应用的配置统一在 build\src\win-x64\publish\gateway 目录维护
|