-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose-base.yaml
58 lines (56 loc) · 1.88 KB
/
docker-compose-base.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
services:
backend:
build:
context: . # 将上下文设置为当前目录
dockerfile: ./docker/backend/Dockerfile
volumes:
- ./app:/app # 将当前目录挂载到容器内的/app
- ./dataset:/dataset # 将宿主机的data目录挂载到容器内的/app/dataset
- ./chroma_db:/chroma_db # 将宿主机的model目录挂载到容器内的/app/model
working_dir: /app # 设置工作目录
# command: ["wait-for-it", "chroma:8000", "--", "python", "server.py"] # 启动后端服务并等待 Chroma 服务
ports:
- "8082:8082"
environment:
- PYTHONUNBUFFERED=1 # 使输出立即显示
- CHROMA_HOST=chroma
- CHROMA_PORT=8000
depends_on:
- chroma
networks:
- smart_bot_network
frontend:
build:
context: ./chatweb
dockerfile: ../docker/frontend/Dockerfile
volumes:
- ./chatweb:/chatweb # 将当前目录挂载到容器内的/chatweb
working_dir: /chatweb # 设置工作目录
command: >
bash -c "
npm install &&
npm run dev" # 安装依赖并启动前端服务
ports:
- "5173:5173" # 映射端口
environment:
- NODE_ENV=development # 设置环境变量为开发模式
networks:
- smart_bot_network
chroma:
build:
context: .
dockerfile: ./docker/chroma/Dockerfile
volumes:
- ./chroma_db:/chroma_db # 挂载 Chroma 数据库目录
- ./app:/app # 挂载应用目录
working_dir: /app # 设置工作目录
# command: >
# bash -c "
# pip install langchain_chroma chromadb &&
# chroma run --path chroma_db --port 8000 --host 0.0.0.0" # 启动 Chroma
ports:
- "8000:8000" # 映射 Chroma 服务端口
networks:
- smart_bot_network
networks:
smart_bot_network: