-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathdocker-compose.e2e.yml
More file actions
96 lines (89 loc) · 3.78 KB
/
docker-compose.e2e.yml
File metadata and controls
96 lines (89 loc) · 3.78 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
version: '3.8'
# ─────────────────────────────────────────────────────────────────────────────
# Vesting Vault — E2E Testing Stack
#
# Extends the base docker-compose.yml to include the Stellar Quickstart
# container (standalone network + Soroban RPC) needed for E2E contract testing.
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.e2e.yml up --build
# ─────────────────────────────────────────────────────────────────────────────
services:
# ── Stellar Quickstart (standalone, local blockchain) ──────────────────────
# Provides:
# - Horizon API on :8000
# - Soroban RPC on :8000/rpc (via --enable-soroban-rpc)
# - Friendbot on :8000/friendbot
#
# "standalone" mode means the network has no consensus peers; it produces
# ledgers at a fixed interval, giving deterministic, fast tests.
stellar-quickstart:
image: stellar/quickstart:latest
container_name: vesting-vault-stellar
command: >
--standalone
--enable-soroban-rpc
ports:
- "8000:8000" # Horizon + Friendbot + Soroban RPC
- "8001:8001" # Internal admin
environment:
# How fast the network produces ledgers (seconds).
# 1 s gives the fastest test feedback without being flaky.
STELLAR_LEDGER_CLOSE_INTERVAL: "1"
networks:
- vesting-network
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 5s
timeout: 10s
retries: 30
start_period: 30s
# ── Backend override for E2E: point at local Stellar Quickstart ───────────
backend:
environment:
NODE_ENV: e2e
STELLAR_RPC_URL: http://stellar-quickstart:8000/rpc
STELLAR_HORIZON_URL: http://stellar-quickstart:8000
STELLAR_NETWORK: standalone
STELLAR_NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
SOROBAN_RPC_URL: http://stellar-quickstart:8000/rpc
depends_on:
stellar-quickstart:
condition: service_healthy
db:
condition: service_healthy
# ── Cypress runner ───────────────────────────────────────────────────────
# Runs the E2E suite as a Docker service so the whole pipeline can be
# orchestrated by a single `docker compose up --exit-code-from cypress` call.
cypress:
image: cypress/included:13.17.0
container_name: vesting-vault-cypress
working_dir: /e2e
entrypoint: cypress run
volumes:
- ./:/e2e
- /e2e/node_modules # don't overwrite host node_modules
environment:
CYPRESS_BASE_URL: http://backend:4000
STELLAR_RPC_URL: http://stellar-quickstart:8000/rpc
STELLAR_HORIZON_URL: http://stellar-quickstart:8000
STELLAR_NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
# Cypress env vars (accessible via Cypress.env() in tests)
CYPRESS_STELLAR_RPC_URL: http://stellar-quickstart:8000/rpc
CYPRESS_STELLAR_HORIZON_URL: http://stellar-quickstart:8000
CYPRESS_STELLAR_NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
networks:
- vesting-network
depends_on:
backend:
condition: service_healthy
stellar-quickstart:
condition: service_healthy
profiles:
- cypress # Only started when the 'cypress' profile is explicitly enabled
volumes:
postgres_data:
redis_data:
networks:
vesting-network:
driver: bridge