Files
cjw 4373fafd55 🐛 fix(deploy): 移除服务 profiles——裸 up / 裸 -f 恢复一键可用
compose 规则:声明了 profiles 的服务在不带 --profile 时永远不会被选中。
拆分首版保留 profiles(双保险设计)导致部署机实测 docker compose up -d
与 -f <file> up -d 均报 "no service selected",与"一键部署、换文件名换
模式"的核心诉求互斥,故彻底移除:

- 三个 compose 文件的全部 services 去掉 profiles 块,模式切换唯一入口 = -f 文件名
- 历史 --profile full/moldinsight/inventory 写法随之失效(目标服务本就已
  移出默认文件,兼容无意义);文档/构建脚本提示/STATUS 日志同步改为失效声明
- frontend/README 移除"仅起前端"用法(前端反代依赖 unified backend,推荐整栈)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-24 16:09:26 +08:00

71 lines
1.6 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.
# geMoldInsight Frontend
这是 geMoldInsight 的独立前端工程,基于:
- Vue 3
- Vite
- TypeScript
- Pinia
- Vue Router
当前推荐部署方式为:
> **独立前端部署 + 同域反代 + unified backend**
即:
- 前端由 Nginx 静态站点独立提供
- `/api`、`/health`、`/html` 通过同域反代统一转发到一个 unified backend
- 前端继续使用相对路径调用后端接口
---
## 本地开发
```bash
npm install
npm run dev
```
开发服务器默认:
- 端口:`5173`
- 已代理:`/api`、`/health`、`/html`
---
## 生产构建
```bash
npm run build
```
构建产物输出到:
- `frontend/dist/`
该目录由前端 Nginx 镜像或外部静态站点托管,不再输出到仓库根目录 `static/`。
---
## 部署
当前仓库已提供:
- [deploy/Dockerfile.frontend](../deploy/Dockerfile.frontend)
- [deploy/nginx/frontend.conf](../deploy/nginx/frontend.conf)
以及根目录 [docker-compose.yml](../docker-compose.yml)(unified 模式)中的 `frontend` 服务。完整系统一键启动:
```bash
docker compose up -d
```
> 旧 `--profile frontend` 仅起前端的写法已随 compose 拆分移除;前端同域反代依赖 unified backend,推荐整栈启动。前后端分离开发时,前端本地 `npm run dev`、后端直跑 `uvicorn`(见 [LINUX_SETUP.md](../docs/deployment/LINUX_SETUP.md) §6)。
---
## 说明
前端历史上曾通过后端 `static/` 目录托管;当前已切换为独立部署模式。后端默认不再负责提供 SPA 页面,但仍提供:
- `/api/*`
- `/health`
- `/html/*`(gemold 分析产物)