Deploy to Render
Render is a “deploy from git” PaaS similar in shape to Railway, with first-party Postgres / Redis but no managed MongoDB. The standard pattern: Render hosts the app, MongoDB Atlas hosts the DB. Render’s free tier suspends after inactivity (cold start ~30s); the $7/mo Starter tier is the practical floor.
Quick reference
Section titled “Quick reference”| Cost (small app) | $7/mo (Render Starter) + Atlas free tier |
| Managed Mongo? | No — external (MongoDB Atlas recommended) |
| Cold start? | Yes on free tier; no on Starter+ |
| TLS | Automatic on *.onrender.com + custom domains |
| Blueprint | Yes (render.yaml) |
Prerequisites
Section titled “Prerequisites”- A Render account.
- A MongoDB Atlas cluster (free M0 tier is fine for small apps).
- The dAvePi project pushed to GitHub.
Deploy
Section titled “Deploy”-
Provision Atlas. Create a free M0 cluster. Add a database user; allowlist
0.0.0.0/0if you can’t pin Render’s egress IPs (Atlas allows IP allowlists, but Render’s egress isn’t a stable single IP on most plans). For production, use a private endpoint or pin a stable egress IP via a network-add-on. -
Create a Render Web Service. New + → Web Service → connect the GitHub repo. Render auto-detects Node.
-
Configure the service. Build command:
npm install. Start command:npm start. Health check path:/healthz. -
Set env vars. Under the service’s Environment tab:
NODE_ENV=productionMONGO_URI=mongodb+srv://user:pass@cluster.mongodb.net/davepiTOKEN_KEY=<long random string>CORS_ORIGINS=https://your-frontend.example.comRender sets
PORTitself; dAvePi reads it via thePORTenv inindex.js. -
Deploy. First build runs on save. Render builds, deploys, and routes traffic once
/healthzreturns 200.
One-click blueprint
Section titled “One-click blueprint”The repo ships a
render.yaml
blueprint at the root. Render’s “Deploy to Render” flow (from a
fork of the repo, or via the Blueprints section of the
dashboard) uses it to provision the service in one click —
auto-generating TOKEN_KEY, prompting for MONGO_URI +
CORS_ORIGINS (marked sync: false so the secret values stay
out of the repo), and setting TRUST_PROXY=true so the rate
limiter keys on real client IPs behind Render’s edge proxy.
Custom domain + TLS
Section titled “Custom domain + TLS”Service → Settings → Custom Domain. Render provides the CNAME target. Let’s Encrypt cert provisions within ~minutes of DNS propagation. Auto-renews.
Backups
Section titled “Backups”Atlas’s free tier doesn’t include continuous backup; the M10
($57/mo) tier does. On the free tier, schedule a mongodump
from a Render cron job:
- New + → Cron Job → same repo. Build command:
npm install. Run command: a small Node script that runsmongodumpand writes to S3.
Or upgrade Atlas to M10+ and use the built-in continuous backup
- point-in-time recovery.
Scaling
Section titled “Scaling”- Vertical: bump the Render plan (Starter → Standard → Pro).
- Horizontal: Render supports auto-scaling on Standard+ plans. dAvePi is stateless; Atlas handles the database tier separately.
- Atlas tier: M0 (free) → M10 ($57/mo) is the practical step up. M10 unlocks continuous backup, point-in-time recovery, and meaningful storage / IOPS.
Observability
Section titled “Observability”- Logs: Render captures stdout, displays live + retains 30 days. Ship to external collectors via the log-drain integration (Datadog / Papertrail / Better Stack).
- Metrics:
/_metricsis reachable from outside Render via the public URL; gate withMETRICS_TOKEN. Configure Grafana Cloud to scrape it.