-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
112 lines (106 loc) · 3.44 KB
/
docker-compose.yml
File metadata and controls
112 lines (106 loc) · 3.44 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
# Docker Compose for SyndDB Local Development
#
# This setup runs:
# 1. Sequencer with local SQLite storage (exposes /da/* API)
# 2. Validator fetching from sequencer via HTTP
# 3. Customer SQLite app (pluggable - swap target for your own app)
#
# Usage:
# docker compose up --build # Or: just docker-up
# docker compose down -v # Or: just docker-down
#
# Test endpoints:
# curl http://localhost:8433/health # Sequencer health
# curl http://localhost:8433/status # Sequencer status (sequence number)
# curl http://localhost:8080/health # Validator health
# curl http://localhost:8080/status # Validator sync status
#
# Configuration:
# All defaults are defined inline below. Create .env to override.
# See also: justfile for the single source of truth on addresses/keys.
#
# Build optimization:
# All services use a single multi-stage Dockerfile (docker/local.Dockerfile).
# Docker BuildKit builds the shared 'builder' stage once and reuses it
# for all service targets, reducing build time by ~4x.
# Default values (same as justfile - DO NOT USE IN PRODUCTION)
x-defaults: &defaults
# Well-known Anvil test key
SIGNING_KEY: ${SIGNING_KEY:-ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80}
# Derived from SIGNING_KEY above
SEQUENCER_PUBKEY: ${SEQUENCER_PUBKEY:-8318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5}
RUST_LOG: ${RUST_LOG:-info}
services:
sequencer:
build:
context: .
dockerfile: docker/local.Dockerfile
target: sequencer
ports:
- "${SEQUENCER_PORT:-8433}:8433"
environment:
<<: *defaults
BIND_ADDRESS: "0.0.0.0:8433"
PUBLISHER_TYPE: local
LOCAL_STORAGE_PATH: ":memory:"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8433/health"]
interval: 5s
timeout: 3s
retries: 3
start_period: 10s
validator:
build:
context: .
dockerfile: docker/local.Dockerfile
target: validator
ports:
- "${VALIDATOR_PORT:-8080}:8080"
environment:
<<: *defaults
BIND_ADDRESS: "0.0.0.0:8080"
FETCHER_TYPE: http
SEQUENCER_URL: "http://sequencer:8433"
DATABASE_PATH: ":memory:"
STATE_DB_PATH: ":memory:"
SYNC_INTERVAL: "1s"
depends_on:
sequencer:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 5s
timeout: 3s
retries: 3
start_period: 10s
# Pluggable customer SQLite application
# Currently uses the orderbook benchmark with full SyndDB integration.
customer_sqlite_app:
build:
context: .
dockerfile: docker/local.Dockerfile
target: customer-app
environment:
<<: *defaults
SEQUENCER_URL: "http://sequencer:8433"
volumes:
- app_data:/data
depends_on:
sequencer:
condition: service_healthy
command: ["run", "--db", "/data/orderbook.db", "--simple", "--duration", "60", "--rate", "100"]
# Session stress test - verifies no SIGSEGV from Session race conditions
stress_test:
build:
context: .
dockerfile: docker/local.Dockerfile
target: stress-test
environment:
<<: *defaults
SEQUENCER_URL: "http://sequencer:8433"
depends_on:
sequencer:
condition: service_healthy
command: ["--duration", "30"]
volumes:
app_data: