Skip to content

Render

Tested with: Render Blueprints (render.yaml) · Render services · PostgreSQL 17

  1. Put the connection string in an Environment Group so web services, workers and cron jobs share it, and reference it from render.yaml.

    render.yaml
    services:
    - type: web
    name: api
    runtime: node
    buildCommand: npm ci && npm run build
    preDeployCommand: npx prisma migrate deploy
    startCommand: npm start
    envVars:
    - fromGroup: databasezy-prod
    envVarGroups:
    - name: databasezy-prod
    envVars:
    - key: DATABASE_URL
    sync: false # set in the dashboard; never in the repo
    - key: PGSSLMODE
    value: verify-full
  2. Every Render service has fixed outbound IPs (Settings → Outbound IPs). Allow them:

    shell
    zb api PUT /v1/orgs/{org}/instances/pg-7f3k/network -d '{"allow_cidrs": ["203.0.113.20/32"]}' # replaces the list
  3. preDeployCommand runs migrations against the direct endpoint before the new version receives traffic.

Use the external connection string from the Render dashboard with zb migrate; see the Render migration guide.