chore: use aliyun middleware images [skip ci]

This commit is contained in:
2026-04-26 08:38:16 +08:00
parent b52143a578
commit f74fcb0ede
4 changed files with 34 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
services: services:
mysql: mysql:
image: mysql:8.0 image: registry.cn-hangzhou.aliyuncs.com/pull-image/mysql:8.0
container_name: zzyl-mysql container_name: zzyl-mysql
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -19,7 +19,7 @@ services:
- mysql_data:/var/lib/mysql - mysql_data:/var/lib/mysql
redis: redis:
image: redis:7.2-alpine image: registry.cn-hangzhou.aliyuncs.com/pull-image/redis:7-alpine
container_name: zzyl-redis container_name: zzyl-redis
restart: unless-stopped restart: unless-stopped
environment: environment:

View File

@@ -1,6 +1,6 @@
services: services:
mysql: mysql:
image: mysql:8.0 image: registry.cn-hangzhou.aliyuncs.com/pull-image/mysql:8.0
container_name: zzyl-mysql container_name: zzyl-mysql
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -24,7 +24,7 @@ services:
retries: 10 retries: 10
redis: redis:
image: redis:7.2-alpine image: registry.cn-hangzhou.aliyuncs.com/pull-image/redis:7-alpine
container_name: zzyl-redis container_name: zzyl-redis
restart: unless-stopped restart: unless-stopped
environment: environment:

View File

@@ -6,12 +6,18 @@
- 前端:`zzyl-ui`Vue 2 项目,使用 `pnpm` 构建,打包为 Nginx 镜像。 - 前端:`zzyl-ui`Vue 2 项目,使用 `pnpm` 构建,打包为 Nginx 镜像。
- 后端:`zzyl-admin`Spring Boot 服务JDK 11容器内端口 `9000` - 后端:`zzyl-admin`Spring Boot 服务JDK 11容器内端口 `9000`
- 中间件MySQL 8、Redis 7。 - 中间件MySQL 8、Redis 7,镜像使用阿里云镜像源
- CIGitHub Actions 构建并推送 `zzyl-admin``zzyl-ui` 两个镜像。 - CIGitHub Actions 构建并推送 `zzyl-admin``zzyl-ui` 两个镜像。
- CD服务器上手动执行 Docker Compose所有运行时变量统一写在 `deploy/compose/.env` - CD服务器上手动执行 Docker Compose所有运行时变量统一写在 `deploy/compose/.env`
生产入口为前端服务:`http://服务器IP或域名:${UI_PORT}/`。前端 `/prod-api/` 会由 Nginx 转发到后端 `zzyl-admin:9000` 生产入口为前端服务:`http://服务器IP或域名:${UI_PORT}/`。前端 `/prod-api/` 会由 Nginx 转发到后端 `zzyl-admin:9000`
部署使用的基础中间件镜像:
- MySQL`registry.cn-hangzhou.aliyuncs.com/pull-image/mysql:8.0`
- Redis`registry.cn-hangzhou.aliyuncs.com/pull-image/redis:7-alpine`
- Nginx`registry.cn-hangzhou.aliyuncs.com/pull-image/nginx:mainline-alpine`
## 2. 需要准备的材料 ## 2. 需要准备的材料
- Linux 服务器,建议 2 核 4G 以上,已安装 Docker Engine、Docker Compose Plugin、Git、curl。 - Linux 服务器,建议 2 核 4G 以上,已安装 Docker Engine、Docker Compose Plugin、Git、curl。
@@ -164,6 +170,28 @@ Redis 与后端运行变量:
说明:当前后端启动时会自动启动华为云 AMQP 消费客户端,所以 `HUAWEI_CLOUD_*` 不能保留 `change_me` 占位值。 说明:当前后端启动时会自动启动华为云 AMQP 消费客户端,所以 `HUAWEI_CLOUD_*` 不能保留 `change_me` 占位值。
### 4.2 中间件清单
| 中间件 | 用途 | 是否必须 |
| --- | --- | --- |
| MySQL 8 | 存储业务数据、系统用户、菜单、养老业务数据、Quartz 任务表 | 必须 |
| Redis 7 | 缓存、验证码、登录 Token、系统临时数据 | 必须 |
| Nginx | 部署前端 `zzyl-ui` 静态资源,并反向代理 `/prod-api/` 到后端 | 必须,已内置在前端镜像中 |
| Docker / Docker Compose | 容器化部署 MySQL、Redis、后端、前端 | 必须 |
| Quartz | 后端定时任务调度,表结构来自 `sql/quartz.sql` | 必须,随后端运行 |
| Druid | 后端数据库连接池和监控页面 | 必须,随 Java 应用运行 |
第三方云服务不算传统中间件,但部署时也会用到:
| 服务 | 用途 | 是否必须 |
| --- | --- | --- |
| 阿里云 OSS | 文件、图片、报告上传存储 | 按功能需要 |
| 华为云 IoTDA / AMQP | 设备管理、设备消息消费 | 当前启动时必须配置 |
| 百度千帆 | 健康评估 AI 生成 | 按功能需要 |
| 微信小程序接口 | 小程序登录、获取手机号 | 按功能需要 |
| 阿里云 ACR 或其他镜像仓库 | 保存 CI 构建出的前后端镜像 | 部署镜像时必须 |
## 5. 首次部署 ## 5. 首次部署
进入部署目录: 进入部署目录:

View File

@@ -12,7 +12,7 @@ RUN pnpm install --frozen-lockfile
COPY . . COPY . .
RUN pnpm build:prod RUN pnpm build:prod
FROM nginx:1.27-alpine FROM registry.cn-hangzhou.aliyuncs.com/pull-image/nginx:mainline-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html