-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.playwright.yml
More file actions
398 lines (385 loc) · 13.1 KB
/
Copy pathdocker-compose.playwright.yml
File metadata and controls
398 lines (385 loc) · 13.1 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
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
386
387
388
389
390
391
392
393
394
395
396
397
398
## Playwright full-flow test.
## Runs all 3 UIs (provider-console, council-console, moonlight-pay) with
## backing platform services. A headed Chromium browser with the Freighter
## wallet extension drives the entire user journey (14 steps).
##
## No setup container — the test itself creates councils, providers, and
## payments through the UI, just like a real user.
services:
stellar:
# Pinned build + protocol come from stellar-pin.env (SSOT). --protocol-version is a
# WORKAROUND for the image's broken default (protocol 25 on a stellar-core v27 image),
# which fails contract upload; remove it when a fixed image ships. See stellar-pin.env.
image: ${STELLAR_QUICKSTART_IMAGE}
command: --local --limits unlimited --protocol-version ${STELLAR_PROTOCOL_VERSION}
healthcheck:
test: >
curl -sf http://localhost:8000/soroban/rpc -X POST
-H "Content-Type: application/json"
-d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}'
| grep -q healthy
interval: 5s
timeout: 5s
retries: 60
start_period: 10s
db:
image: postgres:18
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: devpass
POSTGRES_DB: postgres
volumes:
- ./test/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -d postgres"]
interval: 3s
timeout: 3s
retries: 10
jaeger:
image: jaegertracing/all-in-one:latest
environment:
COLLECTOR_OTLP_ENABLED: "true"
SPAN_STORAGE_TYPE: badger
BADGER_EPHEMERAL: "false"
BADGER_DIRECTORY_KEY: /badger/keys
BADGER_DIRECTORY_VALUE: /badger/values
volumes:
- ./.traces/playwright:/badger
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:16686/api/services || exit 1"]
interval: 2s
timeout: 3s
retries: 15
# ── Backend platforms ──────────────────────────────────────────
provider:
image: denoland/deno:2.7.9
depends_on:
db:
condition: service_healthy
stellar:
condition: service_healthy
jaeger:
condition: service_healthy
volumes:
- ${PROVIDER_PLATFORM_PATH:-../provider-platform}:/app-src:ro
- ./test/provider-entrypoint.sh:/entrypoint.sh:ro
working_dir: /app
entrypoint: ["sh", "/entrypoint.sh"]
environment:
DATABASE_URL: postgresql://admin:devpass@db:5432/provider_platform_db
PORT: "3000"
MODE: development
ALLOWED_ORIGINS: "http://provider-console:3020"
LOG_LEVEL: TRACE
SERVICE_DOMAIN: localhost
PROVIDER_BASE_URL: http://provider:3000
STELLAR_RPC_URL: http://stellar:8000/soroban/rpc
NETWORK: local
NETWORK_FEE: "1000000000"
SERVICE_AUTH_SECRET: test-auth-secret
SERVICE_FEE: "100"
CHALLENGE_TTL: "900"
SESSION_TTL: "21600"
MEMPOOL_SLOT_CAPACITY: "100"
MEMPOOL_EXPENSIVE_OP_WEIGHT: "10"
MEMPOOL_CHEAP_OP_WEIGHT: "1"
MEMPOOL_EXECUTOR_INTERVAL_MS: "5000"
MEMPOOL_VERIFIER_INTERVAL_MS: "10000"
MEMPOOL_TTL_CHECK_INTERVAL_MS: "60000"
MEMPOOL_MAX_RETRY_ATTEMPTS: "3"
BUNDLE_MAX_OPERATIONS: "20"
EVENT_WATCHER_INTERVAL_MS: "5000"
OTEL_DENO: "true"
OTEL_SERVICE_NAME: "provider-platform"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://jaeger:4318"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
healthcheck:
test: >
sh -c 'deno eval "
const r = await fetch(\"http://localhost:3000/api/v1/stellar/auth?account=GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF\");
Deno.exit(r.status < 500 ? 0 : 1);
" 2>/dev/null'
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
council:
image: denoland/deno:2.7.9
depends_on:
db:
condition: service_healthy
stellar:
condition: service_healthy
jaeger:
condition: service_healthy
volumes:
- ${COUNCIL_PLATFORM_PATH:-../council-platform}:/app-src:ro
- ./test/council-entrypoint.sh:/entrypoint.sh:ro
working_dir: /app
entrypoint: ["sh", "/entrypoint.sh"]
environment:
DATABASE_URL: postgresql://admin:devpass@db:5432/council_platform_db
PORT: "8080"
MODE: development
ALLOWED_ORIGINS: "http://council-console:3030"
LOG_LEVEL: TRACE
SERVICE_DOMAIN: localhost
STELLAR_RPC_URL: http://stellar:8000/soroban/rpc
NETWORK: local
NETWORK_FEE: "1000000000"
SERVICE_AUTH_SECRET: test-auth-secret
CHALLENGE_TTL: "900"
SESSION_TTL: "21600"
OTEL_DENO: "true"
OTEL_SERVICE_NAME: "council-platform"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://jaeger:4318"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
healthcheck:
test: >
sh -c 'deno eval "
const r = await fetch(\"http://localhost:8080/api/v1/health\");
Deno.exit(r.status === 200 ? 0 : 1);
" 2>/dev/null'
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
pay:
image: denoland/deno:2.7.9
depends_on:
db:
condition: service_healthy
stellar:
condition: service_healthy
jaeger:
condition: service_healthy
volumes:
- ${PAY_PLATFORM_PATH:-../pay-platform}:/app-src:ro
- ./test/pay-entrypoint.sh:/entrypoint.sh:ro
working_dir: /app
entrypoint: ["sh", "/entrypoint.sh"]
environment:
DATABASE_URL: postgresql://admin:devpass@db:5432/pay_platform_db
PORT: "3025"
MODE: development
NETWORK: local
ALLOWED_ORIGINS: "http://moonlight-pay:3050"
SERVICE_DOMAIN: pay
SERVICE_AUTH_SECRET: test-auth-secret
CHALLENGE_TTL: "300000"
SESSION_TTL: "86400000"
ADMIN_WALLETS: "GA6NODWA2DQPPSLACHV3M2W3ZBGMLHNSCMUCHF4DTIVLDER2THB5BYYJ"
PAY_SERVICE_SK: "SAV7Z6BV2FLTJBP5TGJDI3PAAL5SWX6DDOCU5J3GGYYQ5FGJ6J5CGMUQ"
STELLAR_RPC_URL: http://stellar:8000/soroban/rpc
OTEL_DENO: "true"
OTEL_SERVICE_NAME: "pay-platform"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://jaeger:4318"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
healthcheck:
test: >
sh -c 'deno eval "
const r = await fetch(\"http://localhost:3025/api/v1/health\");
Deno.exit(r.status === 200 ? 0 : 1);
" 2>/dev/null'
interval: 5s
timeout: 5s
retries: 60
start_period: 60s
# ── Frontend services ──────────────────────────────────────────
provider-console:
image: denoland/deno:2.7.9
depends_on:
provider:
condition: service_healthy
volumes:
- ${PROVIDER_CONSOLE_PATH:-../provider-console}:/app-src:ro
working_dir: /app
entrypoint:
- sh
- -c
- |
echo "Copying provider-console source..."
cd /app-src && tar cf - --exclude=node_modules --exclude=.git --exclude=.env . | (cd /app && tar xf -)
cd /app
cat > public/config.js <<'JSEOF'
window.__CONSOLE_CONFIG__ = {
apiBaseUrl: "http://provider:3000/api/v1",
stellarNetwork: "standalone",
horizonUrl: "http://stellar:8000",
environment: "development",
allowlist: ["*"],
};
JSEOF
echo "Installing dependencies..."
deno install
echo "Building..."
deno task build -- --production
echo "Serving on port 3020..."
exec deno task serve
environment:
PORT: "3020"
ENVIRONMENT: development
CSP_CONNECT_HOSTS: "http://*:*"
healthcheck:
test: >
sh -c 'deno eval "
const r = await fetch(\"http://localhost:3020/\");
Deno.exit(r.status === 200 ? 0 : 1);
" 2>/dev/null'
interval: 5s
timeout: 5s
retries: 40
start_period: 30s
council-console:
image: denoland/deno:2.7.9
depends_on:
council:
condition: service_healthy
volumes:
- ${COUNCIL_CONSOLE_PATH:-../council-console}:/app-src:ro
working_dir: /app
entrypoint:
- sh
- -c
- |
echo "Copying council-console source..."
cd /app-src && tar cf - --exclude=node_modules --exclude=.git --exclude=.env . | (cd /app && tar xf -)
cd /app
cat > public/config.js <<'JSEOF'
window.__CONSOLE_CONFIG__ = {
environment: "development",
stellarNetwork: "standalone",
rpcUrl: "http://stellar:8000/soroban/rpc",
horizonUrl: "http://stellar:8000",
friendbotUrl: "http://stellar:8000/friendbot",
platformUrl: "http://council:8080",
allowlist: ["*"],
};
JSEOF
echo "Installing dependencies..."
deno install
echo "Building (includes WASM download)..."
deno task build -- --production
echo "Serving on port 3030..."
exec deno task serve
environment:
PORT: "3030"
MODE: development
CSP_CONNECT_HOSTS: "http://*:*"
healthcheck:
test: >
sh -c 'deno eval "
const r = await fetch(\"http://localhost:3030/\");
Deno.exit(r.status === 200 ? 0 : 1);
" 2>/dev/null'
interval: 5s
timeout: 5s
retries: 40
start_period: 60s
moonlight-pay:
image: denoland/deno:2.7.9
depends_on:
pay:
condition: service_healthy
volumes:
- ${MOONLIGHT_PAY_PATH:-../moonlight-pay}:/app-src:ro
working_dir: /app
entrypoint:
- sh
- -c
- |
echo "Copying moonlight-pay source..."
cd /app-src && tar cf - --exclude=node_modules --exclude=.git --exclude=.env . | (cd /app && tar xf -)
cd /app
cat > public/config.js <<'JSEOF'
window.__PAY_CONFIG__ = {
environment: "development",
stellarNetwork: "standalone",
payPlatformUrl: "http://pay:3025",
rpcUrl: "http://stellar:8000/soroban/rpc",
allowlist: ["*"],
adminWallets: ["*"],
};
JSEOF
echo "Installing dependencies..."
deno install
echo "Building..."
deno task build -- --production
echo "Serving on port 3050..."
exec deno task serve
environment:
PORT: "3050"
MODE: development
CSP_CONNECT_HOSTS: "http://*:*"
healthcheck:
test: >
sh -c 'deno eval "
const r = await fetch(\"http://localhost:3050/\");
Deno.exit(r.status === 200 ? 0 : 1);
" 2>/dev/null'
interval: 5s
timeout: 5s
retries: 40
start_period: 60s
# ── Playwright test runner ─────────────────────────────────────
test-runner:
image: mcr.microsoft.com/playwright:v1.59.1-noble
depends_on:
provider-console:
condition: service_healthy
council-console:
condition: service_healthy
moonlight-pay:
condition: service_healthy
jaeger:
condition: service_healthy
volumes:
- ./playwright:/playwright-src:ro
working_dir: /app
entrypoint:
- sh
- -c
- |
cp -r /playwright-src/. /app/
# The stellar healthcheck only verifies Soroban RPC is up. Horizon's
# friendbot endpoint becomes ready noticeably later. createUserContext
# funds accounts via friendbot with no retry — if friendbot isn't ready
# by the time the first context is created, the account never lands on
# chain and the SEP-53 challenge step fails. Mirrors waitForFriendbot
# in test/setup-e2e.ts.
echo "Waiting for Friendbot..."
ready=0
for i in $$(seq 1 180); do
status=$$(curl -s -o /dev/null -w "%{http_code}" "$${FRIENDBOT_URL}?addr=GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF" 2>/dev/null || echo "000")
if [ "$$status" = "200" ] || [ "$$status" = "400" ]; then
echo " Friendbot ready ($${i}s)."
ready=1
break
fi
sleep 1
done
if [ "$$ready" != "1" ]; then
echo "Friendbot did not become ready after 180s"
exit 1
fi
echo "Installing npm dependencies..."
npm install
echo "Running Playwright tests..."
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" \
npx playwright test full-flow --project=chromium
environment:
TARGET: local
PROVIDER_CONSOLE_URL: http://provider-console:3020
COUNCIL_CONSOLE_URL: http://council-console:3030
MOONLIGHT_PAY_URL: http://moonlight-pay:3050
PROVIDER_API_URL: http://provider:3000
COUNCIL_API_URL: http://council:8080
PAY_API_URL: http://pay:3025
STELLAR_RPC_URL: http://stellar:8000/soroban/rpc
FRIENDBOT_URL: http://stellar:8000/friendbot
FREIGHTER_EXTENSION_PATH: /app/freighter-extension
JAEGER_QUERY_URL: http://jaeger:16686
# In the Docker network postgres is reachable at `db:5432`. helpers/db.ts
# defaults to the dev-host DSN (localhost:5442), so the in-network run
# must override it here.
PG_BASE_URL: postgresql://admin:devpass@db:5432