-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
252 lines (238 loc) · 7.5 KB
/
docker-compose.yaml
File metadata and controls
252 lines (238 loc) · 7.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Base configurations that are common between environments
x-atoma-proxy-base: &atoma-proxy-base
build: &atoma-proxy-base-build
context: .
dockerfile: Dockerfile
volumes:
- ${CONFIG_PATH:-./config.toml}:/app/config.toml
- ./open_router.json:/app/open_router.json
- ./logs:/app/logs
- sui-config-volume:/root/.sui/sui_config
- ${SUI_CONFIG_PATH:-~/.sui/sui_config}:/tmp/.sui/sui_config
- ./data:/app/data
env_file:
- .env
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
- RUST_LOG=${ATOMA_LOG_LEVELS:-info}
depends_on:
db:
condition: service_healthy
networks:
- atoma-network
services:
traefik:
profiles: ["cloud"]
image: traefik:v2.9
container_name: traefik
restart: unless-stopped
command:
- "--log.level=INFO"
# EntryPoints
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
# Enable Docker provider
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
# Let's Encrypt (ACME) configuration
- "--certificatesResolvers.myresolver.acme.httpChallenge=true"
- "--certificatesResolvers.myresolver.acme.httpChallenge.entryPoint=web"
- "--certificatesResolvers.myresolver.acme.email=${ACME_EMAIL}"
- "--certificatesResolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./letsencrypt:/letsencrypt"
networks:
- atoma-network
labels:
- "traefik.http.routers.traefik.rule=Host(`traefik.atoma.network`)"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls.certresolver=myresolver"
- "traefik.http.services.traefik.loadbalancer.server.port=8090"
db:
profiles: ["local", "cloud"]
image: postgres:13
restart: always
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- atoma-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} -p 5432 || exit 1"]
interval: 5s
timeout: 5s
retries: 5
# Local proxy configuration
atoma-proxy-local:
profiles: ["local"]
<<: *atoma-proxy-base
image: ghcr.io/atoma-network/atoma-proxy:local-latest
build:
<<: *atoma-proxy-base-build
args:
PROFILE: local
ports:
- "${ATOMA_SERVICE_PORT:-8080}:8080"
- "${ATOMA_PROXY_SERVICE_PORT:-8081}:8081"
- "${ATOMA_P2P_SERVICE_PORT:-8083}:8083"
# Cloud proxy configuration
atoma-proxy-cloud:
profiles: ["cloud"]
<<: *atoma-proxy-base
image: ghcr.io/atoma-network/atoma-proxy:latest
build:
<<: *atoma-proxy-base-build
args:
PROFILE: cloud
ports:
- "${ATOMA_P2P_PORT:-8083}:8083/udp"
- "${ATOMA_P2P_PORT:-8083}:8083/tcp"
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`api.atoma.network`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls.certresolver=myresolver"
- "traefik.http.routers.api.service=api_service"
- "traefik.http.services.api_service.loadbalancer.server.port=8080" # This is the internal port of the docker, this have to match the port in the config.toml
- "traefik.http.routers.credentials.rule=Host(`credentials.atoma.network`)"
- "traefik.http.routers.credentials.entrypoints=websecure"
- "traefik.http.routers.credentials.tls.certresolver=myresolver"
- "traefik.http.routers.credentials.service=credentials_service"
- "traefik.http.services.credentials_service.loadbalancer.server.port=8081" # This is the internal port of the docker, this have to match the port in the config.toml
backend:
profiles: ["cloud"]
image: mysten/zklogin:prover-stable
volumes:
# The ZKEY environment variable must be set to the path of the zkey file.
- ${ZKEY}:/app/binaries/zkLogin.zkey
environment:
- ZKEY=/app/binaries/zkLogin.zkey
- WITNESS_BINARIES=/app/binaries
networks:
- atoma-network
frontend:
profiles: ["cloud"]
image: mysten/zklogin:prover-fe-stable
command: "8080"
environment:
- PROVER_URI=http://backend:8080/input
- NODE_ENV=production
- DEBUG=zkLogin:info,jwks
# The default timeout is 15 seconds. Uncomment the following line to change it.
# - PROVER_TIMEOUT=30
labels:
- "traefik.enable=true"
- "traefik.http.routers.prover.rule=Host(`prover.atoma.network`)"
- "traefik.http.routers.prover.entrypoints=websecure"
- "traefik.http.routers.prover.tls.certresolver=myresolver"
- "traefik.http.routers.prover.service=prover_service"
- "traefik.http.services.prover_service.loadbalancer.server.port=8080" # This is the internal port of the docker
networks:
- atoma-network
otel-collector:
image: otel/opentelemetry-collector-contrib:0.119.0
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP http receiver
- "8889:8889" # Prometheus metrics exporter
networks:
- atoma-network
depends_on:
- prometheus
- grafana
- loki
- tempo
prometheus:
image: prom/prometheus:v3.1.0
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=1y"
- "--web.enable-lifecycle"
networks:
- atoma-network
grafana:
image: grafana/grafana:11.5.1
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
env_file: .env
environment:
- GF_SERVER_ROOT_URL=http://${GRAFANA_DOMAIN}:${GRAFANA_PORT:-3000}/
networks:
- atoma-network
depends_on:
- prometheus
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
loki:
image: grafana/loki:2.9.4
ports:
- "3100:3100"
command: -config.file=/etc/loki/loki.yaml
volumes:
- ./loki.yaml:/etc/loki/loki.yaml
- loki-data:/loki
networks:
- atoma-network
tempo:
image: grafana/tempo:2.7.0
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./tempo.yaml:/etc/tempo.yaml
- tempo-data:/tmp/tempo
ports:
- "3200:3200"
networks:
- atoma-network
user: "0"
node-exporter:
image: prom/node-exporter:v1.7.0
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.rootfs=/rootfs"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
ports:
- "9101:9100"
networks:
- atoma-network
volumes:
postgres-data:
sui-config-volume:
letsencrypt:
grafana_data:
prometheus-data:
loki-data:
tempo-data:
atoma-local-key:
networks:
atoma-network:
driver: bridge