docs: 更新部署文档
This commit is contained in:
parent
1ec3e28d73
commit
7ba107a82e
35
README.MD
35
README.MD
|
@ -70,4 +70,37 @@ mysql
|
|||
|
||||
## 前端项目
|
||||
|
||||
本仓库是后端项目,对应前端项目地址为:<https://github.com/zze326/devops-super-fe>。
|
||||
本仓库是后端项目,对应前端项目地址为:<https://github.com/zze326/devops-super-fe>。
|
||||
|
||||
## 快速部署
|
||||
|
||||
1、在 MySQL 中执行 `manifest/db/devops_super.sql` 创建好数据库以及初始化数据;
|
||||
|
||||
2、从 [releases](https://github.com/zze326/devops-super/releases) 获取到要部署的镜像版本,以 [v1.0](https://github.com/zze326/devops-super/releases/tag/v1.0) 为例:主程序 Docker 镜像为 `registry.cn-shenzhen.aliyuncs.com/zze/devops-super:202310271518`;
|
||||
|
||||
3、运行容器,看如下实例:
|
||||
```bash
|
||||
docker run -d --name devops-super \
|
||||
-v/opt/devops-super/host-sessions:/app/host-sessions \
|
||||
-eSERVER_PORT=8001 \
|
||||
-eDB_HOST=127.0.0.1 \
|
||||
-eDB_PORT=3306 \
|
||||
-eDB_NAME=devops_super \
|
||||
-eDB_USER=zze \
|
||||
-eDB_PWD=zze.admin \
|
||||
-eJWT_SECRET=vIIEngfamdsaGZasdsasdasadkseadgF9fe \
|
||||
--network host registry.cn-shenzhen.aliyuncs.com/zze/devops-super:202310271518
|
||||
```
|
||||
> 环境变量说明:
|
||||
> - `DB_HOST`:MySQL 主机地址;
|
||||
> - `DB_PORT`:MySQL 端口;
|
||||
> - `DB_NAME`:数据库名称;
|
||||
> - `DB_USER`:连接数据库使用的用户;
|
||||
> - `DB_PWD`:连接数据库的用户密码;
|
||||
> - `JWT_SECRET`:JWT 秘钥,随机生成即可;
|
||||
> - `SERVER_PORT`:服务监听端口;
|
||||
>
|
||||
> 参数说明(按需使用):
|
||||
> - `-d`:后台运行容器;
|
||||
> - `--name`:指定容器名称;
|
||||
> - `--network host`:容器共用宿主机网络空间;
|
|
@ -6,6 +6,7 @@ gfcli:
|
|||
tagPrefixes:
|
||||
# - registry-azj-registry.cn-shanghai.cr.aliyuncs.com/ops/
|
||||
- zze326/
|
||||
- registry.cn-shenzhen.aliyuncs.com/zze/
|
||||
gen:
|
||||
dao:
|
||||
- link: "mysql:devops_super:devops_super.zze@tcp(192.168.2.231:3306)/devops_super?loc=Local&parseTime=true"
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
DATE := $(shell date '+%Y%m%d%H%M')
|
||||
|
||||
image.push:
|
||||
rm -f devops-super-cli && go env -w 'GOPROXY=https://goproxy.cn,direct' && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o devops-super-cli
|
||||
docker build --platform linux/amd64 -t registry.cn-shenzhen.aliyuncs.com/zze/devops-super-ci-client:tmp .
|
||||
docker push registry.cn-shenzhen.aliyuncs.com/zze/devops-super-ci-client:tmp
|
||||
docker build --platform linux/amd64 -t registry.cn-shenzhen.aliyuncs.com/zze/devops-super-ci-client:$(DATE) .
|
||||
docker push registry.cn-shenzhen.aliyuncs.com/zze/devops-super-ci-client:$(DATE)
|
||||
rm -f devops-super-cli
|
Loading…
Reference in New Issue