-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrender.yaml
More file actions
504 lines (455 loc) · 13 KB
/
render.yaml
File metadata and controls
504 lines (455 loc) · 13 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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# Render Blueprint for My Nethesis
# =============================================================================
# Architecture: Private services exposed via proxy
# PRODUCTION: my.nethesis.it (release-based deployment)
# QA: qa.my.nethesis.it (auto-deploy + PR previews)
#
# Env vars are organized in 5 groups per environment (qa, prod):
# - infra-{env} internal service URLs (e.g. MIMIR_URL)
# - spaces-{env} DigitalOcean Spaces credentials and buckets
# - app-secrets-{env} cross-service shared secrets
# - logto-{env} Logto tenant + JWT auth config
# - smtp-{env} SMTP / email config
# Group values are managed in Render Dashboard. Values declared with
# `sync: false` must be set there before first deploy.
# =============================================================================
# =============================================================================
# DATABASES
# =============================================================================
databases:
# Production PostgreSQL Database
- name: my-postgres-prod
plan: basic-256mb
region: frankfurt
databaseName: noc
ipAllowList: []
# QA PostgreSQL Database
- name: my-postgres-qa
plan: basic-256mb
databaseName: noc
ipAllowList: []
# =============================================================================
# ENVIRONMENT VARIABLE GROUPS
# =============================================================================
envVarGroups:
# ---------- PROD ----------
- name: infra-prod
envVars:
- key: MIMIR_URL
value: http://my-mimir-prod:9009
- name: spaces-prod
envVars:
# Shared DigitalOcean Spaces credentials (used by mimir, backend, collect)
- key: S3_ENDPOINT
sync: false
- key: S3_ACCESS_KEY
sync: false
- key: S3_SECRET_KEY
sync: false
# Service-specific buckets
- key: MIMIR_S3_ALERTMANAGER_BUCKET
sync: false
- key: BACKUP_S3_BUCKET
sync: false
- name: app-secrets-prod
envVars:
- key: ALERTING_HISTORY_WEBHOOK_SECRET
sync: false
- name: logto-prod
envVars:
- key: LOGTO_TENANT_ID
sync: false
- key: LOGTO_TENANT_DOMAIN
sync: false
- key: APP_URL
sync: false
- key: JWT_SECRET
sync: false
- key: LOGTO_BACKEND_APP_ID
sync: false
- key: LOGTO_BACKEND_APP_SECRET
sync: false
- name: smtp-prod
envVars:
- key: SMTP_HOST
sync: false
- key: SMTP_PORT
sync: false
- key: SMTP_USERNAME
sync: false
- key: SMTP_PASSWORD
sync: false
- key: SMTP_FROM
sync: false
- key: SMTP_FROM_NAME
sync: false
- key: SMTP_TLS
sync: false
# ---------- QA ----------
- name: infra-qa
envVars:
- key: MIMIR_URL
value: http://my-mimir-qa:9009
- name: spaces-qa
envVars:
# Shared DigitalOcean Spaces credentials (used by mimir, backend, collect)
- key: S3_ENDPOINT
sync: false
- key: S3_ACCESS_KEY
sync: false
- key: S3_SECRET_KEY
sync: false
# Service-specific buckets
- key: MIMIR_S3_ALERTMANAGER_BUCKET
sync: false
- key: BACKUP_S3_BUCKET
sync: false
- name: app-secrets-qa
envVars:
- key: ALERTING_HISTORY_WEBHOOK_SECRET
sync: false
- name: logto-qa
envVars:
- key: LOGTO_TENANT_ID
sync: false
- key: LOGTO_TENANT_DOMAIN
sync: false
- key: APP_URL
sync: false
- key: JWT_SECRET
sync: false
- key: LOGTO_BACKEND_APP_ID
sync: false
- key: LOGTO_BACKEND_APP_SECRET
sync: false
- name: smtp-qa
envVars:
- key: SMTP_HOST
sync: false
- key: SMTP_PORT
sync: false
- key: SMTP_USERNAME
sync: false
- key: SMTP_PASSWORD
sync: false
- key: SMTP_FROM
sync: false
- key: SMTP_FROM_NAME
sync: false
- key: SMTP_TLS
sync: false
services:
# =============================================================================
# PRODUCTION ENVIRONMENT - my.nethesis.it
# Release-based deployment (GitHub Actions)
# =============================================================================
# Production Redis Cache
- type: keyvalue
name: my-redis-prod
plan: starter
region: frankfurt
maxmemoryPolicy: allkeys-lru
ipAllowList: []
# Production Mimir (Private Service - NOT internet accessible)
- type: pserv
name: my-mimir-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/mimir:v0.6.1
envVars:
- fromGroup: spaces-prod
- key: PORT
value: 9009
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
# Production Backend API Server (Private Service)
- type: pserv
name: my-backend-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/backend:v0.6.1
envVars:
- fromGroup: infra-prod
- fromGroup: spaces-prod
- fromGroup: app-secrets-prod
- fromGroup: logto-prod
- fromGroup: smtp-prod
# Server Configuration
- key: GIN_MODE
value: release
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: info
- key: LOG_FORMAT
value: json
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-prod
property: connectionString
- key: REDIS_DB
value: 0
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-prod
property: connectionString
# Backend-only alerting webhook URL (env-specific public URL)
- key: ALERTING_HISTORY_WEBHOOK_URL
sync: false
# Production Collect Service (Private Service)
- type: pserv
name: my-collect-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/collect:v0.6.1
envVars:
- fromGroup: infra-prod
- fromGroup: spaces-prod
- fromGroup: app-secrets-prod
# Server Configuration
- key: GIN_MODE
value: release
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: info
- key: LOG_FORMAT
value: json
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-prod
property: connectionString
- key: REDIS_DB
value: 1
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-prod
property: connectionString
# Production Frontend (Private Service)
- type: pserv
name: my-frontend-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/frontend:v0.6.1
envVars:
- key: VITE_PRODUCT_NAME
value: "My Nethesis"
- key: VITE_LOGTO_ENDPOINT
sync: false # Configure in Render dashboard
- key: VITE_LOGTO_APP_ID
sync: false # Configure in Render dashboard
- key: VITE_API_BASE_URL
value: "/backend/api"
- key: VITE_SIGNIN_REDIRECT_URI
value: "login-redirect"
- key: VITE_SIGNOUT_REDIRECT_URI
value: "login"
# Production Proxy - Public Entry Point (my.nethesis.it)
- type: web
name: my-proxy-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/proxy:v0.6.1
domains:
- my.nethesis.it
envVars:
# Service names for automatic URL generation
- key: BACKEND_SERVICE_NAME
value: my-backend-prod
- key: COLLECT_SERVICE_NAME
value: my-collect-prod
- key: FRONTEND_SERVICE_NAME
value: my-frontend-prod
# =============================================================================
# QA ENVIRONMENT - qa.my.nethesis.it
# Auto-deploy on every commit + PR previews
# =============================================================================
# QA Redis Cache
- type: keyvalue
name: my-redis-qa
plan: starter
maxmemoryPolicy: allkeys-lru
ipAllowList: []
# QA Mimir (Private Service)
- type: pserv
name: my-mimir-qa
runtime: docker
plan: starter
rootDir: services/mimir
dockerfilePath: Containerfile
envVars:
- fromGroup: spaces-qa
- key: PORT
value: 9009
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
autoDeploy: true
branch: main
pullRequestPreviewsEnabled: true
# QA Backend API Server (Private Service)
- type: pserv
name: my-backend-qa
runtime: docker
plan: starter
rootDir: backend
dockerfilePath: Containerfile
envVars:
- fromGroup: infra-qa
- fromGroup: spaces-qa
- fromGroup: app-secrets-qa
- fromGroup: logto-qa
- fromGroup: smtp-qa
# Server Configuration
- key: GIN_MODE
value: debug
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: debug
- key: LOG_FORMAT
value: json
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-qa
property: connectionString
- key: REDIS_DB
value: 0
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-qa
property: connectionString
# Backend-only alerting webhook URL (env-specific public URL)
- key: ALERTING_HISTORY_WEBHOOK_URL
sync: false
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled
# QA Collect Service (Private Service)
- type: pserv
name: my-collect-qa
runtime: docker
plan: starter
rootDir: collect
dockerfilePath: Containerfile
envVars:
- fromGroup: infra-qa
- fromGroup: spaces-qa
- fromGroup: app-secrets-qa
# Server Configuration
- key: GIN_MODE
value: debug
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: debug
- key: LOG_FORMAT
value: json
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-qa
property: connectionString
- key: REDIS_DB
value: 1
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-qa
property: connectionString
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled
# QA Frontend (Private Service)
- type: pserv
name: my-frontend-qa
runtime: docker
plan: starter
rootDir: frontend
dockerfilePath: Containerfile
envVars:
- key: PORT
value: 10000
- key: VITE_PRODUCT_NAME
value: "My Nethesis"
- key: VITE_LOGTO_ENDPOINT
sync: false # Configure in Render dashboard
- key: VITE_LOGTO_APP_ID
sync: false # Configure in Render dashboard
- key: VITE_API_BASE_URL
value: "/backend/api"
- key: VITE_SIGNIN_REDIRECT_URI
value: "login-redirect"
- key: VITE_SIGNOUT_REDIRECT_URI
value: "login"
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled
# QA Proxy - Public Entry Point (qa.my.nethesis.it)
- type: web
name: my-proxy-qa
runtime: docker
plan: starter
rootDir: proxy
dockerfilePath: Containerfile
domains:
- qa.my.nethesis.it
envVars:
# Dynamic service names from other services
- key: BACKEND_SERVICE_NAME
fromService:
name: my-backend-qa
type: pserv
property: host
- key: COLLECT_SERVICE_NAME
fromService:
name: my-collect-qa
type: pserv
property: host
- key: FRONTEND_SERVICE_NAME
fromService:
name: my-frontend-qa
type: pserv
property: host
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled