forked from HitEmPoka/StellPoker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
158 lines (151 loc) · 4.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
158 lines (151 loc) · 4.5 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '3.8'
x-json-logging: &json-logging
logging:
driver: json-file
options:
max-size: "100m"
max-file: "3"
services:
# Soroban local network (stellar quickstart)
soroban:
image: stellar/quickstart:latest
command: --local --enable-soroban-rpc
ports:
- "8000:8000"
healthcheck:
# CMD-SHELL so a failure echoes a greppable WARN line into the health
# log (docker inspect --format '{{json .State.Health}}').
test: ["CMD-SHELL", "curl -fsS http://localhost:8000 || (echo 'WARN: soroban health check failed' >&2; exit 1)"]
interval: 5s
timeout: 3s
retries: 30
# Stellar quickstart takes a while to bring up Horizon + RPC.
start_period: 30s
<<: *json-logging
# MPC Node 0
mpc-node-0:
build:
context: .
dockerfile: services/node/Dockerfile
environment:
NODE_ID: "0"
PORT: "8101"
MPC_PORT: "10000"
PARTY_CONFIG: "/app/config/party_0.toml"
CIRCUIT_DIR: "/app/circuits"
CRS_DIR: "/app/crs"
REQUEST_LOG_FORMAT: "json"
ports:
- "8101:8101"
- "10000:10000"
volumes:
- ./crs:/app/crs
- ./circuits:/app/circuits:ro
- ./services/node/config:/app/config:ro
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8101/health || (echo 'WARN: mpc-node-0 health check failed' >&2; exit 1)"]
interval: 5s
timeout: 3s
retries: 30
# co-noir key generation + CRS load can take 30-60s on a cold start;
# failures during this window do not count against `retries`.
start_period: 60s
<<: *json-logging
# MPC Node 1
mpc-node-1:
build:
context: .
dockerfile: services/node/Dockerfile
environment:
NODE_ID: "1"
PORT: "8102"
MPC_PORT: "10001"
PARTY_CONFIG: "/app/config/party_1.toml"
CIRCUIT_DIR: "/app/circuits"
CRS_DIR: "/app/crs"
REQUEST_LOG_FORMAT: "json"
ports:
- "8102:8102"
- "10001:10001"
volumes:
- ./crs:/app/crs
- ./circuits:/app/circuits:ro
- ./services/node/config:/app/config:ro
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8102/health || (echo 'WARN: mpc-node-1 health check failed' >&2; exit 1)"]
interval: 5s
timeout: 3s
retries: 30
# co-noir key generation + CRS load can take 30-60s on a cold start;
# failures during this window do not count against `retries`.
start_period: 60s
<<: *json-logging
# MPC Node 2
mpc-node-2:
build:
context: .
dockerfile: services/node/Dockerfile
environment:
NODE_ID: "2"
PORT: "8103"
MPC_PORT: "10002"
PARTY_CONFIG: "/app/config/party_2.toml"
CIRCUIT_DIR: "/app/circuits"
CRS_DIR: "/app/crs"
REQUEST_LOG_FORMAT: "json"
ports:
- "8103:8103"
- "10002:10002"
volumes:
- ./crs:/app/crs
- ./circuits:/app/circuits:ro
- ./services/node/config:/app/config:ro
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8103/health || (echo 'WARN: mpc-node-2 health check failed' >&2; exit 1)"]
interval: 5s
timeout: 3s
retries: 30
# co-noir key generation + CRS load can take 30-60s on a cold start;
# failures during this window do not count against `retries`.
start_period: 60s
<<: *json-logging
# Coordinator (orchestrates MPC + serves API to web app)
coordinator:
build:
context: .
dockerfile: services/coordinator/Dockerfile
env_file:
- path: .env.local
required: false
environment:
MPC_NODE_0: "http://mpc-node-0:8101"
MPC_NODE_1: "http://mpc-node-1:8102"
MPC_NODE_2: "http://mpc-node-2:8103"
SOROBAN_RPC: "http://soroban:8000/soroban/rpc"
CIRCUIT_DIR: "/app/circuits"
CRS_DIR: "/app/crs"
BIND_ADDR: "0.0.0.0:8080"
REQUEST_LOG_FORMAT: "json"
ports:
- "8080:8080"
volumes:
- ./crs:/app/crs
- ./circuits:/app/circuits:ro
depends_on:
soroban:
condition: service_healthy
mpc-node-0:
condition: service_healthy
mpc-node-1:
condition: service_healthy
mpc-node-2:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/api/health || (echo 'WARN: coordinator health check failed' >&2; exit 1)"]
interval: 5s
timeout: 3s
retries: 30
start_period: 20s
<<: *json-logging
# Web app
# app is deployed on Vercel — run locally with: cd app && npm run dev