-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathcompose.yaml
More file actions
188 lines (175 loc) · 5.32 KB
/
Copy pathcompose.yaml
File metadata and controls
188 lines (175 loc) · 5.32 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
services:
# ── Development services (default profile) ──────────────────────────────────
backend:
image: node:20-alpine
working_dir: /app/backend
command: sh -c "npm install && npm run dev"
environment:
PORT: 3001
CORS_ALLOWED_ORIGINS: http://localhost:5173
STELLAR_NETWORK: testnet
DEPLOY_STRATEGY: blue-green
ports:
- '3001:3001'
volumes:
- ./:/app
- backend_node_modules:/app/backend/node_modules
# Blue environment — serves production traffic by default.
# In a blue/green deployment this is the currently live backend.
backend-blue:
image: ${DEPLOY_IMAGE_TAG:-trivela-backend:latest}
profiles: ['blue-green']
working_dir: /app
environment:
PORT: 3001
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:5173}
STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
SOROBAN_RPC_URL: ${SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org}
HORIZON_URL: ${HORIZON_URL:-https://horizon-testnet.stellar.org}
DEPLOY_STRATEGY: blue-green
ports:
- '3001:3001'
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://localhost:3001/health || exit 1']
interval: 10s
timeout: 3s
start_period: 5s
retries: 3
# Green environment — the new version under validation.
# Runs on port 3002 while blue continues to serve traffic.
# Traffic is switched to green only after health checks pass.
backend-green:
image: ${DEPLOY_IMAGE_TAG:-trivela-backend:latest}
profiles: ['green']
working_dir: /app
environment:
PORT: 3002
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:5173}
STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
SOROBAN_RPC_URL: ${SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org}
HORIZON_URL: ${HORIZON_URL:-https://horizon-testnet.stellar.org}
DEPLOY_STRATEGY: blue-green
ports:
- '3002:3002'
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://localhost:3002/health || exit 1']
interval: 10s
timeout: 3s
start_period: 5s
retries: 3
frontend:
image: node:20-alpine
working_dir: /app/frontend
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
environment:
VITE_API_URL: http://backend:3001
VITE_STELLAR_NETWORK: testnet
depends_on:
- backend
ports:
- '5173:5173'
volumes:
- ./:/app
- frontend_node_modules:/app/frontend/node_modules
redis:
image: redis:7-alpine
profiles: ['redis']
ports:
- '6379:6379'
jaeger:
image: jaegertracing/all-in-one:1.62
profiles: ['tracing']
environment:
COLLECTOR_OTLP_ENABLED: 'true'
ports:
- '16686:16686'
- '4318:4318'
- '4317:4317'
postgres:
image: postgres:16-alpine
profiles: ['postgres']
environment:
POSTGRES_USER: trivela
POSTGRES_PASSWORD: trivela
POSTGRES_DB: trivela
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U trivela -d trivela']
interval: 5s
timeout: 5s
retries: 5
# ── Issue #616: Local devnet (one-command full-stack) ───────────────────────
stellar-local:
image: stellar/quickstart:latest
profiles: ['devnet']
command: --local --enable-soroban-rpc
ports:
- '8000:8000' # Horizon + friendbot
- '8001:8001' # Soroban RPC
healthcheck:
test: ['CMD-SHELL', 'curl -sf http://localhost:8000/health || exit 1']
interval: 5s
timeout: 5s
start_period: 20s
retries: 12
devnet-bootstrap:
image: node:20-alpine
profiles: ['devnet']
working_dir: /app
command: sh -c "apk add --no-cache bash curl && bash scripts/devnet-bootstrap.sh"
environment:
STELLAR_NETWORK: local
STELLAR_RPC_URL: http://stellar-local:8001
HORIZON_URL: http://stellar-local:8000
STELLAR_SOURCE: devnet-root
volumes:
- ./:/app
depends_on:
stellar-local:
condition: service_healthy
backend-devnet:
image: node:20-alpine
profiles: ['devnet']
working_dir: /app/backend
command: sh -c "npm install && npm run dev"
environment:
PORT: 3001
STELLAR_NETWORK: local
SOROBAN_RPC_URL: http://stellar-local:8001
HORIZON_URL: http://stellar-local:8000
CORS_ALLOWED_ORIGINS: http://localhost:5173
ports:
- '3001:3001'
volumes:
- ./:/app
- devnet_backend_modules:/app/backend/node_modules
depends_on:
devnet-bootstrap:
condition: service_completed_successfully
frontend-devnet:
image: node:20-alpine
profiles: ['devnet']
working_dir: /app/frontend
command: sh -c "npm install && npm run dev -- --host"
environment:
VITE_STELLAR_NETWORK: local
VITE_SOROBAN_RPC_URL: http://localhost:8001
ports:
- '5173:5173'
volumes:
- ./:/app
- devnet_frontend_modules:/app/frontend/node_modules
depends_on:
devnet-bootstrap:
condition: service_completed_successfully
volumes:
backend_node_modules:
backend_blue_modules:
backend_green_modules:
frontend_node_modules:
postgres_data:
devnet_backend_modules:
devnet_frontend_modules: