Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
193 lines (185 loc) · 5.05 KB
/
Copy pathdocker-compose.yml
File metadata and controls
193 lines (185 loc) · 5.05 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
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://trustlink:trustlink@db:5432/trustlink_db
- REDIS_URL=redis://redis:6379
- SEP10_JWT_SECRET=your-super-secure-jwt-secret-at-least-32-characters-long
- ADMIN_ADDRESS=GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- OTEL_ENABLED=true
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318
- OTEL_SERVICE_NAME=trustlink-backend
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
jaeger:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=trustlink
- POSTGRES_PASSWORD=trustlink
- POSTGRES_DB=trustlink_db
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trustlink -d trustlink_db"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
jaeger:
image: jaegertracing/all-in-one:1.62
ports:
- "16686:16686" # Jaeger UI
- "4318:4318" # OTLP HTTP receiver
environment:
- COLLECTOR_OTLP_ENABLED=true
restart: unless-stopped
# Production profile services
app-prod:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://trustlink:${POSTGRES_PASSWORD}@db-prod:5432/trustlink_db
- REDIS_URL=redis://redis-prod:6379
- SEP10_JWT_SECRET=${SEP10_JWT_SECRET}
- ADMIN_ADDRESS=${ADMIN_ADDRESS}
- PRESIGN_SECRET=${PRESIGN_SECRET}
- SYSTEM_SIGNER_SECRET=${SYSTEM_SIGNER_SECRET}
- CONTRACT_ID=${CONTRACT_ID}
- FRONTEND_URL=${FRONTEND_URL}
- EVIDENCE_STORAGE_BASE_URL=${EVIDENCE_STORAGE_BASE_URL}
- CONTACT_ENCRYPTION_KEY=${CONTACT_ENCRYPTION_KEY}
- CREDENTIAL_ENCRYPTION_KEY=${CREDENTIAL_ENCRYPTION_KEY}
- STELLAR_WEBHOOK_SECRET=${STELLAR_WEBHOOK_SECRET}
- SENTRY_DSN=${SENTRY_DSN}
- SOROBAN_RPC_URL=${SOROBAN_RPC_URL}
- STELLAR_NETWORK=${STELLAR_NETWORK:-MAINNET}
- OTEL_ENABLED=${OTEL_ENABLED:-false}
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}
- OTEL_SERVICE_NAME=trustlink-backend
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS}
- API_BASE_URL=${API_BASE_URL}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- SENDGRID_FROM_EMAIL=${SENDGRID_FROM_EMAIL}
- TWILIO_ACCOUNT_SID=${TWILIO_ACCOUNT_SID}
- TWILIO_AUTH_TOKEN=${TWILIO_AUTH_TOKEN}
- TWILIO_FROM_NUMBER=${TWILIO_FROM_NUMBER}
depends_on:
db-prod:
condition: service_healthy
redis-prod:
condition: service_healthy
restart: always
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
profiles:
- production
db-prod:
image: postgres:16-alpine
environment:
- POSTGRES_USER=trustlink
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=trustlink_db
volumes:
- postgres_data_prod:/var/lib/postgresql/data
restart: always
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trustlink -d trustlink_db"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
profiles:
- production
redis-prod:
image: redis:7-alpine
restart: always
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
logging:
driver: json-file
options:
max-size: 10m
max-file: 3
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
profiles:
- production
volumes:
postgres_data:
redis_data:
app_data:
postgres_data_prod: