Deploy / Render

Render

Same image as Railway, declared in render.yaml.

services:
  - type: web
    name: sales-index
    runtime: docker
    dockerfilePath: ./Dockerfile
    healthCheckPath: /health
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: sales-db
          property: connectionString
      - key: SL_API_KEY
        sync: false

databases:
  - name: sales-db

Push it and Render provisions both from the blueprint.

web, not worker

A Background Worker gets no health check and no PORT. Declaring type: web is what makes /health reachable — the tradeoff is a public URL, so keep the route read-only.

fromDatabase wires the managed instance above. For an external Postgres, drop the databases: block and set DATABASE_URL directly:

- key: DATABASE_URL
        sync: false

sync: false keeps the value out of the repo — set it in the dashboard on first deploy.

Render sends SIGTERM and waits before killing. The shutdown handler finishes the current batch inside that window; zero-downtime deploys briefly overlap two instances, which at-least-once delivery and idempotent writes already cover.