feat: add Docker support and update backend dependencies
- Introduced `requirements.docker.txt` for Docker-specific dependencies. - Updated `requirements.txt` to include `psycopg[binary]` and `python-multipart`. - Enhanced test suite in `test_main_endpoints.py` to cover document CRUD operations. - Modified `docker-compose.yml` to include PostgreSQL and frontend services. - Added Nginx configuration for reverse proxying API requests. - Refactored file handling in Vue components to support new document storage backend. - Created new utility functions in `docsApi.js` for document management. - Updated configuration to support new API endpoints for document operations. - Adjusted Vite configuration to proxy API requests to the local backend.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
- 这是一个智能 Markdown 编辑器,前端负责编辑器 UI、上传导出、补全交互和设置状态,后端负责 LLM、OCR、文件转换和 TTS 接口。
|
||||
- 前端技术栈:Vue 3 + Vite + Milkdown/Crepe + Pinia + Vue Router。
|
||||
- 后端技术栈:FastAPI + Python + Ollama。
|
||||
- 后端技术栈:FastAPI + Python + OpenAI-compatible LLM endpoint。
|
||||
|
||||
## 功能块系统(核心概念)
|
||||
|
||||
@@ -73,6 +73,21 @@
|
||||
- pytest backend/tests/test_prompt.py -v
|
||||
- pytest backend/tests/test_llm.py -v
|
||||
|
||||
## Docker 部署约定
|
||||
|
||||
- 本机部署目录固定在 `/Volumes/New Volume/lit/` 下,不在仓库外再散落数据库或 Docker 持久化目录。
|
||||
- 当前推荐的部署工作目录是 `/Volumes/New Volume/lit/llm-in-text/`;把仓库同步到该目录后,从该目录执行 `docker compose up -d --build`。
|
||||
- Docker 持久化数据统一落在部署目录内的 `docker-data/`,包括 PostgreSQL、Redis 和任务共享临时目录。
|
||||
- 容器内访问宿主机模型服务时,不要继续使用 `localhost`;应改成 `host.docker.internal` 之类的容器可达地址。
|
||||
- 当前 Docker 部署默认使用轻量后端依赖集(`backend/requirements.docker.txt`),覆盖补全、OCR、转换、文档空间和队列,不默认包含本地 `torch` / TTS / ASR 模型栈。
|
||||
- 修改 Docker 相关文件时,除了代码本身,还要同步检查:
|
||||
- `docker-compose.yml`
|
||||
- `backend/Dockerfile`
|
||||
- `backend/requirements.docker.txt`
|
||||
- `Dockerfile.frontend`
|
||||
- `docker/nginx.conf`
|
||||
- `backend/.env.example` 与实际部署用 `backend/.env`
|
||||
|
||||
## 代码约定
|
||||
|
||||
- 不要把整个仓库当成“全小写+短横线命名”项目。当前实际情况是:
|
||||
@@ -120,4 +135,3 @@
|
||||
- README.md 对产品功能有参考价值,但其中补全、TTS/ASR 和部分接口说明已经比代码旧。
|
||||
- backend/TTS_ASR_MACOS_FIX.md 和 backend/tests/TESTING_GUIDE.md 更适合作为历史背景,不应在与代码冲突时被当成事实来源。
|
||||
- 修改行为时,优先参考实现代码和对应测试,再决定是否同步普通文档。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user