-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
127 lines (123 loc) · 3.17 KB
/
docker-compose.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
services:
ethereum-node:
image: ${ETHEREUM_NODE_IMAGE:-}
mem_limit: 4g
build:
context: ./docker/anvil
dockerfile: Dockerfile
ports:
- "${ETH_PORT:-8545}:8545"
environment:
- CHAIN_ID=${CHAIN_ID:-31337}
- ACCOUNTS=${ACCOUNTS:-10}
- BALANCE=${BALANCE:-100000}
command: >
anvil
--host 0.0.0.0
--port 8545
--chain-id ${CHAIN_ID:-31337}
--accounts ${ACCOUNTS:-10}
--balance ${BALANCE:-100000}
networks:
- ttc-network
postgres:
image: postgres:15
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=ttc
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ttc-network
prover-server:
image: ${PROVER_SERVER_IMAGE:-}
privileged: true
mem_limit: 8g
build:
context: .
dockerfile: docker/servers/Dockerfile
target: prover-server
expose:
- "3000"
depends_on:
ethereum-node:
condition: service_started
postgres:
condition: service_healthy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/risc0-work-dir:/tmp/risc0-work-dir
environment:
- RUST_LOG=${RUST_LOG:-info}
- RISC0_DEV_MODE=${RISC0_DEV_MODE:-true}
- RISC0_WORK_DIR=/tmp/risc0-work-dir
- DB_HOST=postgres
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_NAME=ttc
- NODE_HOST=ethereum-node
- NODE_PORT=${ETH_PORT:-8545}
- JSON_RPC_PORT=3000
- IMAGE_ID_CONTRACT=/app/monitor/contract/ImageID.sol
command: >
sh -c "/app/target/release/prover-server"
networks:
prover-network:
ttc-network:
aliases:
- prover-server
healthcheck:
test: ["CMD", "curl", "-f", "-s", "-XPOST", "-H", "Content-Type: application/json",
"-d", "{\"jsonrpc\":\"2.0\",\"method\":\"healthCheck\",\"params\":[],\"id\":1}",
"http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
monitor-server:
image: ${MONITOR_SERVER_IMAGE:-}
mem_limit: 4g
build:
context: .
dockerfile: docker/servers/Dockerfile
target: monitor-server
ports:
- "${JSON_RPC_PORT:-3030}:3030"
depends_on:
ethereum-node:
condition: service_started
postgres:
condition: service_healthy
prover-server:
condition: service_healthy
environment:
- RUST_LOG=${RUST_LOG:-info}
- DB_HOST=postgres
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_NAME=ttc
- NODE_HOST=ethereum-node
- NODE_PORT=${ETH_PORT:-8545}
- PROVER_HOST=prover-server
- PROVER_PORT=3000
- JSON_RPC_PORT=3030
command: >
sh -c "/app/target/release/monitor-server"
networks:
- ttc-network
- prover-network
networks:
ttc-network:
driver: bridge
prover-network:
driver: bridge
internal: true