-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yaml
54 lines (50 loc) · 1.38 KB
/
compose.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
version: '3.8'
services:
frontend:
build:
context: ./src/frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
env_file:
- ./src/frontend/.env
environment:
- NEXT_PUBLIC_BACKEND_API=http://backend:8000/api/v1/chat
- NEXT_PUBLIC_WEB3_HTTP_PROVIDER=http://blockchain:8545/
depends_on:
- backend
- blockchain
backend:
build:
context: ./src/ai-agent
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- ./src/ai-agent/.env
environment:
- RPC_URL=http://blockchain:8545
depends_on:
- blockchain
blockchain:
build:
context: ./src/smartcontract
dockerfile: Dockerfile
ports:
- "8545:8545"
env_file:
- ./src/smartcontract/.env
volumes:
- ./src/smartcontract:/app
command: >
sh -c "
anvil --host 0.0.0.0 &
sleep 5 &&
forge script script/MileStoneMaker.s.sol --rpc-url http://localhost:8545 --broadcast --private-key ${BLOCKCHAIN_PRIVATE_KEY} |
tee /tmp/deployment_output.txt &&
CONTRACT_ADDRESS=$$(grep -oP 'Contract Address: \K[0-9a-fA-F]+' /tmp/deployment_output.txt) &&
cast send $${CONTRACT_ADDRESS} 'setAIAgent(address)' ${AI_AGENT_ADDRESS} --rpc-url http://localhost:8545 --private-key ${BLOCKCHAIN_PRIVATE_KEY} &&
tail -f /dev/null
"
volumes:
blockchain_data: