Render
Reylo Migrate on Render
Run your migrations as your service's pre-deploy command:
services:
- type: web
name: app
runtime: node
# ...
preDeployCommand: npx reylo migrate deployIt runs after the build, on an instance of its own. A migration that fails stops the deploy, and the previous one keeps serving. Pre-deploy commands need a paid plan.
Database
Declare your database in the Blueprint, and set DATABASE_URL from it:
databases:
- name: db
services:
- type: web
name: app
# ...
envVars:
- key: DATABASE_URL
fromDatabase:
name: db
property: connectionStringBuilds
A build that type-checks reads your schema before the pre-deploy command migrates it. Give it a database of its own.
Other images
A Next.js standalone build, or any image without your node_modules, has no reylo command. Copy it from Reylo's image, with your reylo directory:
COPY --from=ghcr.io/reylosql/reylo:0.8.3 /usr/local/bin/reylo /usr/local/bin/reylo
COPY reylo/ reylo/Copy .reylo.yaml too, if you have one. Then run it directly:
services:
- type: web
name: app
runtime: docker
# ...
preDeployCommand: reylo migrate deploy