-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
385 lines (359 loc) · 12 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
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
services:
database:
container_name: database
image: postgres
environment:
POSTGRES_USER: $PG_USER
POSTGRES_PASSWORD: $PG_PASSWORD
POSTGRES_DB: $PG_DB
PGPORT: $PG_PORT
volumes:
- database-data:/var/lib/postgresql/data/
# - ./init-dbs.sh:/docker-entrypoint-initdb.d/init-dbs.sh
ports:
- $PG_PORT:$PG_PORT
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 5s
retries: 10
resolver_consumer:
image: ghcr.io/0xintuition/consumer:latest
command: ./consumer --mode resolver
environment:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_REGION: $AWS_REGION
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
CONSUMER_TYPE: $CONSUMER_TYPE
DATABASE_URL: $DATABASE_URL
ENS_CONTRACT_ADDRESS: $ENS_CONTRACT_ADDRESS
IMAGE_GUARD_URL: $IMAGE_GUARD_URL
IPFS_GATEWAY_URL: $IPFS_GATEWAY_URL
IPFS_UPLOAD_URL: $IPFS_UPLOAD_URL
IPFS_UPLOAD_QUEUE_URL: $IPFS_UPLOAD_QUEUE_URL
LOCALSTACK_URL: $LOCALSTACK_URL
PINATA_API_JWT: $PINATA_API_JWT
PINATA_GATEWAY_TOKEN: $PINATA_GATEWAY_TOKEN
PG_MIN_CONNECTIONS: $PG_MIN_CONNECTIONS
RESOLVER_QUEUE_URL: $RESOLVER_QUEUE_URL
RPC_URL_BASE: $RPC_URL_BASE
RPC_URL_MAINNET: $RPC_URL_MAINNET
RUST_LOG: $RUST_LOG
BACKEND_SCHEMA: $BACKEND_SCHEMA
restart: always
depends_on:
sqs:
condition: service_healthy
volumes:
- ~/.aws/:/root/.aws:ro
- ./logs:/app/logs
deploy:
replicas: 2
ipfs_upload_consumer:
image: ghcr.io/0xintuition/consumer:latest
command: ./consumer --mode ipfs-upload
environment:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_REGION: $AWS_REGION
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
CONSUMER_TYPE: $CONSUMER_TYPE
DATABASE_URL: $DATABASE_URL
IMAGE_GUARD_URL: $IMAGE_GUARD_URL
IPFS_GATEWAY_URL: $IPFS_GATEWAY_URL
IPFS_UPLOAD_URL: $IPFS_UPLOAD_URL
LOCALSTACK_URL: $LOCALSTACK_URL
PINATA_API_JWT: $PINATA_API_JWT
PINATA_GATEWAY_TOKEN: $PINATA_GATEWAY_TOKEN
PG_MIN_CONNECTIONS: $PG_MIN_CONNECTIONS
IPFS_UPLOAD_QUEUE_URL: $IPFS_UPLOAD_QUEUE_URL
RUST_LOG: $RUST_LOG
BACKEND_SCHEMA: $BACKEND_SCHEMA
restart: always
depends_on:
sqs:
condition: service_healthy
volumes:
- ~/.aws/:/root/.aws:ro
- ./logs:/app/logs
deploy:
replicas: 2
decoded_consumer:
container_name: decoded_consumer
image: ghcr.io/0xintuition/consumer:latest
command: ./consumer --mode decoded
environment:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_REGION: $AWS_REGION
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
CONSUMER_METRICS_API_PORT: $CONSUMER_METRICS_API_PORT
CONSUMER_TYPE: $CONSUMER_TYPE
DATABASE_URL: $DATABASE_URL
DECODED_LOGS_QUEUE_URL: $DECODED_LOGS_QUEUE_URL
INTUITION_CONTRACT_ADDRESS: $INTUITION_CONTRACT_ADDRESS
LOCALSTACK_URL: $LOCALSTACK_URL
PG_MIN_CONNECTIONS: $PG_MIN_CONNECTIONS
RESOLVER_QUEUE_URL: $RESOLVER_QUEUE_URL
RPC_URL_BASE: $RPC_URL_BASE
RUST_LOG: $RUST_LOG
BACKEND_SCHEMA: $BACKEND_SCHEMA
restart: always
depends_on:
sqs:
condition: service_healthy
volumes:
- ~/.aws/:/root/.aws:ro
- ./logs:/app/logs
ports:
- 3002:3002
raw_consumer:
container_name: raw_consumer
image: ghcr.io/0xintuition/consumer:latest
command: ./consumer --mode raw
environment:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_REGION: $AWS_REGION
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
CONSUMER_TYPE: $CONSUMER_TYPE
DATABASE_URL: $DATABASE_URL
DECODED_LOGS_QUEUE_URL: $DECODED_LOGS_QUEUE_URL
INDEXING_SOURCE: $INDEXING_SOURCE
LOCALSTACK_URL: $LOCALSTACK_URL
PG_MIN_CONNECTIONS: $PG_MIN_CONNECTIONS
RAW_CONSUMER_QUEUE_URL: $RAW_CONSUMER_QUEUE_URL
RPC_URL_BASE: $RPC_URL_BASE
RPC_URL_MAINNET: $RPC_URL_MAINNET
RUST_LOG: $RUST_LOG
BACKEND_SCHEMA: $BACKEND_SCHEMA
restart: always
depends_on:
sqs:
condition: service_healthy
volumes:
- ~/.aws/:/root/.aws:ro
- ./logs:/app/logs
sqs:
container_name: sqs
image: localstack/localstack:latest
ports:
# - "127.0.0.1:53:53"
# - "127.0.0.1:53:53/udp"
# - "127.0.0.1:443:443"
- "127.0.0.1:4566:4566"
- "127.0.0.1:4571:4571"
volumes:
- ./consumer/devops/localstack-setup.sh:/etc/localstack/init/ready.d/script.sh
environment:
# Set an env var to use later in the code
- ALLOW_NONSTANDARD_REGIONS=1
- AWS_DEFAULT_REGION=us-east-1
- AWS_ENDPOINT=http://localstack:4566
- DEBUG=1
- DOCKER_HOST=0.0.0.0
- EXTRA_CORS_ALLOWED_ORIGINS=app://.
- HOSTNAME_EXTERNAL=localstack
- RUST_LOG=debug
- SERVICES=sqs
api:
container_name: api
image: ghcr.io/0xintuition/image-guard:latest
environment:
CLASSIFICATION_API_PORT: $CLASSIFICATION_API_PORT
DATABASE_URL: $DATABASE_URL
HF_TOKEN: $HF_TOKEN
IPFS_GATEWAY_URL: $IPFS_GATEWAY_URL
IPFS_UPLOAD_URL: $IPFS_UPLOAD_URL
PINATA_API_JWT: $PINATA_API_JWT
RUST_LOG: $RUST_LOG
FLAG_LOCAL_WITH_CLASSIFICATION: $FLAG_LOCAL_WITH_CLASSIFICATION
BE_SCHEMA: $BACKEND_SCHEMA
# FLAG_LOCAL_WITH_DB_ONLY: $FLAG_LOCAL_WITH_DB_ONLY
# FLAG_HF_CLASSIFICATION: $FLAG_HF_CLASSIFICATION
ports:
- 3000:3000
rpc-proxy:
container_name: rpc-proxy
image: ghcr.io/0xintuition/rpc-proxy:latest
environment:
DATABASE_URL: $DATABASE_URL
PROXY_API_PORT: $PROXY_API_PORT
PROXY_SCHEMA: $PROXY_SCHEMA
BASE_MAINNET_RPC_URL: $BASE_MAINNET_RPC_URL
BASE_SEPOLIA_RPC_URL: $BASE_SEPOLIA_RPC_URL
ETHEREUM_MAINNET_RPC_URL: $ETHEREUM_MAINNET_RPC_URL
RUST_LOG: $RUST_LOG
ports:
- $PROXY_API_PORT:$PROXY_API_PORT
depends_on:
database:
condition: service_healthy
safe-content:
container_name: safe-content
image: steelcityamir/safe-content-ai:latest
ports:
- 8000:8000
graphql-engine:
container_name: graphql-engine
image: hasura/graphql-engine:v2.44.0
ports:
- '8080:8080'
restart: always
environment:
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://testuser:test@database:$PG_PORT/storage
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true'
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: 'anonymous'
HASURA_GRAPHQL_DEV_MODE: 'true'
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET: $HASURA_GRAPHQL_ADMIN_SECRET
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: 'true'
PINATA_AUTH: Bearer $PINATA_API_JWT
depends_on:
database:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 30s
timeout: 10s
retries: 5
ipfs:
container_name: ipfs
image: ipfs/kubo:latest
restart: always
ports:
- 4001:4001
- 4002:4002/udp
- 4003:4003
- 5001:5001
- 8081:8080
environment:
IPFS_PATH: /data/ipfs
PINATA_API_JWT: $PINATA_API_JWT
volumes:
- ipfs_data:/data/ipfs
entrypoint: /bin/sh
command: >
-c "
# Initialize IPFS if not initialized
if [ ! -f /data/ipfs/config ]; then
ipfs init;
fi;
# Configure IPFS to listen on all interfaces for API and Gateway
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001;
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080;
# Add Pinata as a remote pinning service
ipfs pin remote service add Pinata https://api.pinata.cloud/psa $PINATA_API_JWT;
# Configure Pinata gateway and use subdomains
ipfs config --json Gateway.PublicGateways '{\"localhost\": {\"UseSubdomains\": false,\"Paths\": [\"/ipfs\", \"/ipns\"]},\"ipfs\": {\"UseSubdomains\": false,\"Paths\": [\"/ipfs\", \"/ipns\"]}}';
# Set Pinata as the default remote pinning service
ipfs config --json Pinning.RemoteServices '[\"Pinata\"]';
# Configure policy to automatically pin all files to Pinata (MFS policy)
ipfs config --json Pinning.RemoteServices.Pinata.Policies '{\"MFS\":{\"Enable\": false,\"PinName\": \"\",\"RepinInterval\": \"1m\"}}';
# Add Peering to Pinata (optional)
ipfs config --json Peering.Peers '[{\"ID\": \"Qma8ddFEQWEU8ijWvdxXm3nxU7oHsRtCykAaVz8WUYhiKn\", \"Addrs\": [\"/dnsaddr/bitswap.pinata.cloud\"]}]';
# Start the IPFS daemon
exec ipfs daemon --migrate=true --agent-version-suffix=docker
"
# substreams-sink:
# container_name: substreams-sink
# image: ghcr.io/0xintuition/substreams-sink:latest
# restart: always
# entrypoint: ["./substreams-sink"]
# environment:
# LOCALSTACK_URL: $LOCALSTACK_URL
# AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
# AWS_REGION: $AWS_REGION
# AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
# DATABASE_URL: $DATABASE_URL
# RAW_CONSUMER_QUEUE_URL: $RAW_CONSUMER_QUEUE_URL
# SUBSTREAMS_ENDPOINT: $SUBSTREAMS_ENDPOINT
# SUBSTREAMS_PACKAGE: $SUBSTREAMS_PACKAGE
# SUBSTREAMS_MODULE: $SUBSTREAMS_MODULE
# SUBSTREAMS_START_BLOCK: $SUBSTREAMS_START_BLOCK
# SUBSTREAMS_API_TOKEN: $SUBSTREAMS_API_TOKEN
# command: ["$SUBSTREAMS_ENDPOINT", "$SUBSTREAMS_PACKAGE", "$SUBSTREAMS_MODULE", "$SUBSTREAMS_START_BLOCK:"]
# depends_on:
# sqs:
# condition: service_healthy
# hasura-migrations:
# condition: service_started
# volumes:
# - substreams-sink-data:/data
envio-indexer:
container_name: envio-indexer
image: ghcr.io/0xintuition/envio-indexer:latest
environment:
LOCALSTACK_URL: $LOCALSTACK_URL
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_REGION: $AWS_REGION
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
INDEXER_DATABASE_URL: $DATABASE_URL
RAW_CONSUMER_QUEUE_URL: $RAW_CONSUMER_QUEUE_URL
HYPERSYNC_TOKEN: $HYPERSYNC_TOKEN
INDEXER_SCHEMA: $INDEXER_SCHEMA
depends_on:
sqs:
condition: service_healthy
indexer-migrations:
condition: service_started
command: ["--network", "base-mainnet", "--output", "postgres"]
indexer-migrations:
container_name: indexer-migrations
image: ghcr.io/0xintuition/indexer-and-cache-migrations:latest
environment:
INDEXER_DATABASE_URL: $DATABASE_URL
depends_on:
database:
condition: service_healthy
restart: "no"
histoflux:
container_name: histoflux
image: ghcr.io/0xintuition/histoflux:latest
environment:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_REGION: $AWS_REGION
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
INDEXER_DATABASE_URL: $DATABASE_URL
LOCALSTACK_URL: $LOCALSTACK_URL
HISTOFLUX_CURSOR_ID: $HISTOFLUX_CURSOR_ID
depends_on:
database:
condition: service_healthy
sqs:
condition: service_healthy
envio-indexer:
condition: service_started
hasura-migrations:
container_name: hasura-migrations
image: ghcr.io/0xintuition/hasura-migrations:latest
environment:
HASURA_GRAPHQL_ENDPOINT: $HASURA_GRAPHQL_ENDPOINT
HASURA_GRAPHQL_ADMIN_SECRET: $HASURA_GRAPHQL_ADMIN_SECRET
depends_on:
database:
condition: service_healthy
graphql-engine:
condition: service_healthy
restart: "no"
prometheus:
container_name: prometheus
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/alert.rules:/etc/prometheus/alert.rules
- ./prometheus/recording.rules:/etc/prometheus/recording.rules
command:
- '--config.file=/etc/prometheus/prometheus.yml'
depends_on:
- api
networks:
intuition-be:
driver: bridge
volumes:
sqs:
raw_consumer:
decoded_consumer:
database-data:
pgadmin-data:
ipfs_data:
substreams-sink-data: