forked from StellarCommons/stellar-fee-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.yaml
More file actions
74 lines (71 loc) · 2.65 KB
/
Copy pathrender.yaml
File metadata and controls
74 lines (71 loc) · 2.65 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
## Render Blueprint — Stellar Fee Tracker
## Deploy: connect the repo in the Render dashboard → New → Blueprint
## https://render.com/docs/blueprint-spec
services:
# ── 1. Backend — Rust / Axum API ────────────────────────────────────────────
- type: web
name: stellar-fee-tracker-api
runtime: docker
dockerfilePath: ./Dockerfile
dockerContext: .
plan: free
healthCheckPath: /health
# Render injects PORT=10000; the binary reads PORT as fallback for API_PORT.
# No disk on free tier — SQLite uses ephemeral container storage.
# Data resets on restart; Horizon history is refetched automatically.
envVars:
- key: STELLAR_NETWORK
value: testnet
- key: POLL_INTERVAL_SECONDS
value: "30"
- key: DATABASE_URL
value: sqlite:///tmp/stellar_fees.db
- key: RUST_LOG
value: info
- key: ALLOWED_ORIGINS
value: "*"
# ── 2. Frontend — Next.js ───────────────────────────────────────────────────
- type: web
name: stellar-fee-tracker-ui
runtime: node
rootDir: packages/ui
buildCommand: npm ci && npm run build
startCommand: npm start
plan: free
envVars:
- key: NEXT_PUBLIC_API_URL
value: /api
- key: BACKEND_HOST
# "host" gives the bare hostname: stellar-fee-tracker-api.onrender.com
# next.config.ts prepends https:// so rewrites get a full URL.
fromService:
name: stellar-fee-tracker-api
type: web
property: host
- key: NEXT_PUBLIC_STELLAR_NETWORK
value: testnet
- key: NODE_ENV
value: production
# ── 3. Keep-alive cron — prevents free-tier cold starts ─────────────────────
# Free-tier web services sleep after 15 min of inactivity.
# Ping /health every 14 minutes to keep the backend warm.
- type: cron
name: stellar-keep-alive
schedule: "*/14 * * * *"
runtime: node
buildCommand: "true"
startCommand: >-
node -e "
const host = process.env.BACKEND_HOST;
const url = 'https://' + host + '/health';
console.log('Pinging', url);
fetch(url)
.then(r => { console.log('Status:', r.status); if (!r.ok) process.exit(1); })
.catch(e => { console.error(e.message); process.exit(1); });
"
envVars:
- key: BACKEND_HOST
fromService:
name: stellar-fee-tracker-api
type: web
property: host