Add V2 local dev compose
This commit is contained in:
7
ai_knowledge_base_v2/apps/backend/.dockerignore
Normal file
7
ai_knowledge_base_v2/apps/backend/.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
||||
.env
|
||||
.venv/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
.pytest_cache/
|
||||
.mypy_cache/
|
||||
.ruff_cache/
|
||||
15
ai_knowledge_base_v2/apps/backend/Dockerfile
Normal file
15
ai_knowledge_base_v2/apps/backend/Dockerfile
Normal 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"]
|
||||
@@ -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 黑名单。
|
||||
|
||||
5
ai_knowledge_base_v2/apps/user-client/.dockerignore
Normal file
5
ai_knowledge_base_v2/apps/user-client/.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.env.local
|
||||
*.tsbuildinfo
|
||||
12
ai_knowledge_base_v2/apps/user-client/Dockerfile
Normal file
12
ai_knowledge_base_v2/apps/user-client/Dockerfile
Normal 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"]
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user