-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.p2p-3nodes.yml
More file actions
80 lines (76 loc) · 2.45 KB
/
docker-compose.p2p-3nodes.yml
File metadata and controls
80 lines (76 loc) · 2.45 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Docker Compose — 3-Node P2P MiroFish Cluster
#
# 啟動 3 個 MiroFish 後端節點,互相配置為 peers,
# 並開啟 P2P_AUTO_PREDICT 讓它們收到種子後自動跑模擬。
#
# Usage:
# docker compose -f docker-compose.p2p-3nodes.yml build
# docker compose -f docker-compose.p2p-3nodes.yml up
#
# 測試:
# node cli/bin/mirofish.js predict "BTC 突破 15 萬" --p2p --rounds=3
# (需要先在 host 端設定 peers 指向 localhost:5011/5012/5013)
services:
node1:
build:
context: .
dockerfile: Dockerfile.p2p-node
container_name: mirofish-p2p-node1
ports:
- "5011:5001"
environment:
- NODE_NAME=node1
- P2P_AUTO_PREDICT=true
- LLM_API_KEY=${LLM_API_KEY}
- LLM_BASE_URL=${LLM_BASE_URL}
- LLM_MODEL_NAME=${LLM_MODEL_NAME}
- ZEP_API_KEY=${ZEP_API_KEY}
- MIROFISH_URL=http://localhost:5001
- PEERS_JSON=[{"id":"node2","endpoint":"http://node2:5001","active":true,"addedAt":0},{"id":"node3","endpoint":"http://node3:5001","active":true,"addedAt":0}]
networks:
- p2p-net
extra_hosts:
- "host.docker.internal:host-gateway"
node2:
build:
context: .
dockerfile: Dockerfile.p2p-node
container_name: mirofish-p2p-node2
ports:
- "5012:5001"
environment:
- NODE_NAME=node2
- P2P_AUTO_PREDICT=true
- LLM_API_KEY=${LLM_API_KEY}
- LLM_BASE_URL=${LLM_BASE_URL}
- LLM_MODEL_NAME=${LLM_MODEL_NAME}
- ZEP_API_KEY=${ZEP_API_KEY}
- MIROFISH_URL=http://localhost:5001
- PEERS_JSON=[{"id":"node1","endpoint":"http://node1:5001","active":true,"addedAt":0},{"id":"node3","endpoint":"http://node3:5001","active":true,"addedAt":0}]
networks:
- p2p-net
extra_hosts:
- "host.docker.internal:host-gateway"
node3:
build:
context: .
dockerfile: Dockerfile.p2p-node
container_name: mirofish-p2p-node3
ports:
- "5013:5001"
environment:
- NODE_NAME=node3
- P2P_AUTO_PREDICT=true
- LLM_API_KEY=${LLM_API_KEY}
- LLM_BASE_URL=${LLM_BASE_URL}
- LLM_MODEL_NAME=${LLM_MODEL_NAME}
- ZEP_API_KEY=${ZEP_API_KEY}
- MIROFISH_URL=http://localhost:5001
- PEERS_JSON=[{"id":"node1","endpoint":"http://node1:5001","active":true,"addedAt":0},{"id":"node2","endpoint":"http://node2:5001","active":true,"addedAt":0}]
networks:
- p2p-net
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
p2p-net:
driver: bridge