add: env example

This commit is contained in:
2026-09-21 12:57:02 +08:00
parent 4fad31e438
commit 4718b2ace7
4 changed files with 38 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ pnpm build # 生产构建(vue-tsc 类型检查 + vite build)
### 3. Docker 一键部署(推荐用于演示/验收)
```bash
cp .env.example .env # 可选:按需修改端口/密码/JWT 密钥
docker compose up -d --build # 构建并启动 mariadb + backend + frontend
# 前端:http://localhost (Nginx 托管静态资源并反代 /api)
# 后端:http://localhost:8080
@@ -56,8 +57,8 @@ docker compose down -v # 停止并清空数据库(下次启动重建
- 编排:`mariadb:11.4`(数据持久化到命名卷)+ 后端多阶段构建镜像(JRE 21,非 root 运行)+ Nginx 前端镜像
- 三个服务均配置健康检查,后端与前端会等待上游就绪后再启动
- 可用环境变量覆盖:`WEB_PORT`(默认 80)、`BACKEND_PORT`(默认 8080)、
`DB_NAME` / `DB_USER` / `DB_PASSWORD` / `DB_ROOT_PASSWORD`、`LAB_JWT_SECRET`
- 可用环境变量(见 `.env.example`):`WEB_PORT`(默认 80)、`BACKEND_PORT`(默认 8080)、
`DB_NAME` / `DB_USER` / `DB_PASSWORD` / `DB_ROOT_PASSWORD`、`LAB_JWT_SECRET`、`JAVA_OPTS`
### 4. 演示账号
@@ -138,6 +139,7 @@ mvn verify # 运行全部测试并执行 JaCoCo 覆盖率门禁
│ └── nginx.conf
├── Dockerfile # 后端多阶段构建镜像
├── docker-compose.yml # mariadb + backend + frontend 一键编排
├── .env.example # 部署环境变量示例(复制为 .env 使用)
└── docs/design.md # 需求分析与详细设计
```