arch-design-agent-skill-das.../design/technology-architecture/01-runtime-topology.md

59 lines
1.4 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.

---
doc_id: DOC-TA-001
title: 运行时拓扑
version: 0.1.0
status: reviewed
owners:
- 林然
upstream:
- ./00-technology-selection.md
downstream:
- ./01-runtime-components.csv
- ./02-environments.csv
updated_at: 2026-03-23
---
# 运行时拓扑
## 部署架构
```mermaid
flowchart LR
Browser["浏览器<br/>(林然)"] -->|HTTP :80| Nginx["Nginx 容器<br/>静态文件 + 反代"]
Nginx -->|/api/* → :8900| Backend["Python 容器<br/>FastAPI + Uvicorn"]
Backend -->|File I/O| DesignVol["/mnt/designs<br/>(volume mount)"]
Backend -->|File I/O| CodeVol["/mnt/code<br/>(volume mount, Phase 2)"]
Backend -->|JSON R/W| Registry["/data/projects.json<br/>(volume mount)"]
```
## Docker Compose 结构
```yaml
services:
frontend:
build: ./frontend
ports: ["80:80"]
# Nginx serve 静态文件 + 反代 /api → backend:8900
backend:
build: ./backend
expose: ["8900"]
volumes:
- ${DESIGN_DIRS}:/mnt/designs:rw
- ${CODE_DIRS}:/mnt/code:ro # Phase 2
- dashboard-data:/data
environment:
- REGISTRY_PATH=/data/projects.json
volumes:
dashboard-data:
```
## 关键说明
- 前端容器只负责 Nginx不运行 Node.js
- 后端容器通过 volume 访问宿主机的设计文件和代码目录
- 设计文件 volume 是 rw编辑功能需要写代码 volume 是 ro
- projects.json 放在 named volume 中,容器重建不丢失
- 无数据库容器