Documentation Frameworks and migration

Migrate from Render

Translate render.yaml services, pre-deploy commands, workers, crons and Postgres to Gregale.

~3 min read
On this page

A Render web service usually moves to Gregale without code changes: both build from source or a Dockerfile, set PORT, and pass configuration as environment variables. Gregale does not read render.yaml; this page maps its pieces to Gregale's and walks through a move.

How Render maps to Gregale

RenderGregale
Web serviceApp, deployed with gregale deploy
InstanceInstance: a Firecracker microVM per instance. Idle apps park and wake on the next request.
Native runtime build and start commandsSource builds detect Node, Python and Go and infer the start command (Deploy a web framework); pin it with hosting.start in gregale.yaml
Docker runtimeYour Dockerfile, as is (Container compatibility)
Pre-deploy commandA release command: release.command in gregale.yaml or release: in a Procfile
Health check pathhosting.health in gregale.yaml
Private serviceA service in the same project, called by name
Background workerA background worker service in a project: a service without ports: runs all the time
Cron jobCrons, which call a path on your app on a schedule
Environment variables and secret filesSecrets (gregale env set) and environment variables
Render PostgresManaged PostgreSQL, bound to the app as DATABASE_URL
Preview environmentsPreview environments
Custom domainsCustom domains
Blueprint (render.yaml)gregale.yaml, or a Compose file for several services

Translate the service settings

A Render web service like this:

yaml
# render.yaml
services:
  - type: web
    name: my-api
    runtime: python
    buildCommand: pip install -r requirements.txt
    startCommand: gunicorn app:app
    preDeployCommand: python manage.py migrate
    healthCheckPath: /healthz

becomes:

yaml
# gregale.yaml
hosting:
  start: gunicorn app:app --bind 0.0.0.0:$PORT
  health: /healthz
release:
  command: python manage.py migrate

Gregale installs dependencies from the manifest itself (and runs a Node build script when there is one), so there is no separate build command; custom build steps belong in a Dockerfile. Name the bind address and port in the start command: Gregale sets PORT for every app.

Check what Gregale detects, from the repository root:

bash
gregale deploy --dry-run

Copy the configuration and deploy

Put the service's environment variables in a KEY=VALUE file, one per line, with values exactly as they should arrive (no quotes). Then deploy:

bash
gregale deploy --name my-api --secrets-file render.env
rm render.env

The values are sealed before the first deployment starts. If it fails:

bash
gregale app health my-api --errors
gregale logs my-api

The database

Gregale has no one-step import from Render Postgres. Either keep using it for now (apps reach outside hosts on ports 80 and 443 only, so on Pro and Scale open the port with gregale app egress-ports add my-api 5432), or create a managed database and restore a pg_dump into it:

bash
gregale add postgres --app my-api --region <region>
gregale postgres attach my-api-postgres my-api --access migration --env MIGRATION_DATABASE_URL

Restore through Connect from your laptop (it needs app tasks on your plan), and run migrations with MIGRATION_DATABASE_URL, the credential that can change the schema. DATABASE_URL goes through a connection pooler in transaction mode; see Managed PostgreSQL.

Several services

A Blueprint with a web service, private services and background workers becomes one project: describe the services in a Compose file and deploy it with gregale deploy. Services call each other by name, and a service without ports: runs all the time as a worker.

Switch traffic

Add your domain to the Gregale app and verify it as Custom domains describes, then move DNS. Suspend the Render service once the Gregale app has served traffic for a while.

Spotted a problem on this page? Tell us