Add V2 local dev compose

This commit is contained in:
2026-07-06 17:45:24 +08:00
parent e9f3db9ab2
commit 96742de07b
10 changed files with 177 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
.env
.venv/
__pycache__/
*.py[cod]
.pytest_cache/
.mypy_cache/
.ruff_cache/

View File

@@ -0,0 +1,15 @@
FROM python:3.12-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8100
CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8100"]

View File

@@ -26,6 +26,15 @@
## 本地启动
方式一:使用 V2 统一编排。
```bash
cd ai_knowledge_base_v2
docker compose -f docker-compose.dev.yml up --build
```
方式二:本地 Python 直接启动。
```bash
cd ai_knowledge_base_v2/apps/backend
python -m venv .venv
@@ -39,7 +48,5 @@ uvicorn app.main:app --reload --host 127.0.0.1 --port 8100
## 下一步
- 补 Alembic 初始迁移脚本。
- 补聊天会话和消息接口。
- 补管理员登录接口。
- 接入 Redis 替换内存短信验证码和 Token 黑名单。

View File

@@ -0,0 +1,5 @@
node_modules/
dist/
.env
.env.local
*.tsbuildinfo

View File

@@ -0,0 +1,12 @@
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5173"]

View File

@@ -15,6 +15,15 @@
## 本地启动
方式一:使用 V2 统一编排。
```bash
cd ai_knowledge_base_v2
docker compose -f docker-compose.dev.yml up --build
```
方式二:本地 Node 直接启动。
```bash
cd ai_knowledge_base_v2/apps/user-client
npm install