Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (84 loc) · 3.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (84 loc) · 3.74 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
# Two independent indexers, one per network. Nothing is shared between them:
# separate volumes, separate published ports, separate health. A Sepolia feed
# and a mainnet feed are different chains with different pools, and an
# instance that mixed them would be publishing a lie — `mirror-pull` already
# refuses a manifest whose `chain_id` disagrees with its own profile.
#
# Every knob below is an env wrapper over a flag that already exists; nothing
# here is a compose-only concept. Put overrides in a `.env` file next to this
# one (it is gitignored) or export them in the shell.
#
# docker compose up -d --build
# docker compose logs -f mainnet
# curl -s localhost:8080/health | jq
#
# Ports bind to 127.0.0.1 by default. Putting the indexer straight onto a
# public interface is a deployment decision, not a default — see
# docs/ops/hosting.md.
services:
mainnet:
build:
context: .
dockerfile: Dockerfile
image: strk20-indexer:latest
# `--network mainnet` selects the whole verified profile: pool address,
# genesis block, chain id, epoch size and the decoder class map. The RPC
# URLs below default to the profile's own endpoints, so an operator who
# sets nothing at all still gets a working mainnet instance.
environment:
STRK20_NETWORK: mainnet
STRK20_FEEDER_URL: ${MAINNET_FEEDER_URL:-https://feeder.alpha-mainnet.starknet.io/feeder_gateway}
STRK20_RPC_WS_URL: ${MAINNET_RPC_WS_URL:-wss://starknet-rpc.publicnode.com}
STRK20_RPC_URL: ${MAINNET_RPC_URL:-https://api.cartridge.gg/x/starknet/mainnet}
STRK20_RPC_FALLBACK: ${MAINNET_RPC_FALLBACK:-https://starknet.publicnode.com}
RUST_LOG: ${RUST_LOG:-info}
# `--allow-class` has no env binding in the CLI, so it is interpolated
# into the argument list instead. Empty by default: the mainnet profile
# already carries its supported classes. Set
# MAINNET_ALLOW_CLASS="--allow-class 0x..." after an upgrade the profile
# does not know about yet, to keep decoding instead of degrading.
command: run --listen 0.0.0.0:8080 ${MAINNET_ALLOW_CLASS:-}
ports:
- "${MAINNET_BIND:-127.0.0.1}:${MAINNET_PORT:-8080}:8080"
volumes:
- mainnet-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
interval: 30s
timeout: 5s
retries: 3
# `/health` reports UNHEALTHY until the first ingest cycle writes a head,
# and a cold first cycle includes historical backfill. Allow startup
# time before marking the container unhealthy.
start_period: 90m
sepolia:
build:
context: .
dockerfile: Dockerfile
image: strk20-indexer:latest
# The Sepolia profile owns pool identity and the supported decoder classes.
# RPC defaults must match SEPOLIA_RPC_PRIMARY/FALLBACK in config.rs.
# Configure proof support as well as ordinary block/event transport.
environment:
STRK20_NETWORK: sepolia
STRK20_FEEDER_URL: ${SEPOLIA_FEEDER_URL:-https://feeder.alpha-sepolia.starknet.io/feeder_gateway}
STRK20_RPC_WS_URL: ${SEPOLIA_RPC_WS_URL:-wss://starknet-sepolia-rpc.publicnode.com}
STRK20_RPC_URL: ${SEPOLIA_RPC_URL:-https://api.cartridge.gg/x/starknet/sepolia}
STRK20_RPC_FALLBACK: ${SEPOLIA_RPC_FALLBACK:-https://starknet-sepolia-rpc.publicnode.com}
RUST_LOG: ${RUST_LOG:-info}
command: run --listen 0.0.0.0:8080 ${SEPOLIA_ALLOW_CLASS:-}
ports:
- "${SEPOLIA_BIND:-127.0.0.1}:${SEPOLIA_PORT:-8081}:8080"
volumes:
- sepolia-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 90m
volumes:
mainnet-data:
sepolia-data: