Subchapter 29.1
references/blueprint-spec.mdMarkdown16 KBView on GitHub
Complete reference for render.yaml Blueprint files. Blueprints define your infrastructure as code for reproducible deployments on Render.
A Blueprint is a YAML file (typically render.yaml) placed in your repository root that describes:
# Top-level fields
services: [] # Array of service definitions
databases: [] # Array of PostgreSQL databases
envVarGroups: [] # Reusable environment variable groups (optional)
projects: [] # Project organization (optional)
ungrouped: [] # Resources outside projects (optional)
previews: # Preview environment configuration (optional)
generation: auto_preview | manual | noneHTTP services, APIs, and web applications. Publicly accessible via HTTPS.
Required fields:
name: Unique service identifiertype: Must be webruntime: Language/environment (see Runtimes section)buildCommand: Command to build the applicationstartCommand: Command to start the serverCommon optional fields:
plan: Instance type (default: free)region: Deployment region (default: oregon)branch: Git branch to deploy (default: main)autoDeploy: Auto-deploy on push (default: true)envVars: Environment variables arrayhealthCheckPath: Health check endpoint (default: /)numInstances: Number of instances (manual scaling)scaling: Autoscaling configurationExample:
services:
- type: web
name: api-server
runtime: node
plan: free
buildCommand: npm ci
startCommand: npm start
branch: main
autoDeploy: true
envVars:
- key: NODE_ENV
value: production
- key: PORT
value: 10000Background job processors, queue consumers. Not publicly accessible.
Required fields:
name: Unique service identifiertype: Must be workerruntime: Language/environmentbuildCommand: Command to buildstartCommand: Command to start worker processKey differences from web services:
Example:
services:
- type: worker
name: job-processor
runtime: python
plan: free
buildCommand: pip install -r requirements.txt
startCommand: celery -A tasks worker --loglevel=info
envVars:
- key: REDIS_URL
fromDatabase:
name: redis
property: connectionStringScheduled tasks that run on a cron schedule.
Required fields:
name: Unique service identifiertype: Must be cronruntime: Language/environmentschedule: Cron expressionbuildCommand: Command to buildstartCommand: Command to execute on scheduleSchedule format: Standard cron syntax (minute hour day month weekday)
Examples:
0 0 * * * - Daily at midnight UTC*/15 * * * * - Every 15 minutes0 9 * * 1 - Every Monday at 9 AM UTCExample:
services:
- type: cron
name: daily-backup
runtime: node
schedule: "0 2 * * *"
buildCommand: npm ci
startCommand: node scripts/backup.js
envVars:
- key: DATABASE_URL
fromDatabase:
name: postgres
property: connectionStringServe static HTML/CSS/JS files via CDN.
Required fields:
name: Unique service identifiertype: webruntime: staticbuildCommand: Command to build static assetsstaticPublishPath: Path to built files (e.g., ./build, ./dist)Optional configuration:
routes: Routing rules for SPAsheaders: Custom HTTP headersbuildFilter: Path filters for build triggersExample:
services:
- type: web
name: react-app
runtime: static
buildCommand: npm ci && npm run build
staticPublishPath: ./dist
routes:
- type: rewrite
source: /*
destination: /index.html
headers:
- path: /*
name: Cache-Control
value: public, max-age=31536000, immutableInternal services accessible only within your Render account.
Required fields:
name: Unique service identifiertype: Must be pservruntime: Language/environmentbuildCommand: Command to buildstartCommand: Command to startUse cases:
Example:
services:
- type: pserv
name: internal-api
runtime: go
plan: free
buildCommand: go build -o bin/app
startCommand: ./bin/appNode.js (runtime: node):
package.json engines fieldPython (runtime: python):
runtime.txt or PipfileGo (runtime: go):
go.modRuby (runtime: ruby):
.ruby-version or GemfileRust (runtime: rust):
Elixir (runtime: elixir):
Docker (runtime: docker):
Build from a Dockerfile in your repository.
Additional fields:
dockerfilePath: Path to Dockerfile (default: ./Dockerfile)dockerContext: Build context directory (default: .)Example:
services:
- type: web
name: docker-app
runtime: docker
dockerfilePath: ./docker/Dockerfile
dockerContext: .
plan: freeImage (runtime: image):
Deploy pre-built Docker images from a registry.
Additional fields:
image: Image URL (e.g., registry.com/image:tag)registryCredential: Credentials for private registriesExample:
services:
- type: web
name: prebuilt-app
runtime: image
image: myregistry.com/app:v1.2.3
plan: freeAvailable instance types:
| Plan | RAM | CPU | Price |
|---|---|---|---|
free | 512 MB | 0.5 | Free (750 hrs/mo) |
starter | 512 MB | 0.5 | $7/month |
standard | 2 GB | 1 | $25/month |
pro | 4 GB | 2 | $85/month |
pro_plus | 8 GB | 4 | $175/month |
Always default to plan: free unless user specifies otherwise.
Available deployment regions:
oregon (US West) - Defaultohio (US East)virginia (US East)frankfurt (EU)singapore (Asia)Example:
services:
- type: web
name: my-app
runtime: node
region: frankfurtThree patterns for defining environment variables:
For non-sensitive configuration:
envVars:
- key: NODE_ENV
value: production
- key: API_URL
value: https://api.example.com
- key: LOG_LEVEL
value: infoRender generates a base64-encoded 256-bit random value:
envVars:
- key: SESSION_SECRET
generateValue: true
- key: ENCRYPTION_KEY
generateValue: truePrompt user for values during Blueprint creation:
envVars:
- key: STRIPE_SECRET_KEY
sync: false
- key: JWT_SECRET
sync: false
- key: API_KEY
sync: falseThe sync: false flag means “user will fill this in the Dashboard”.
Link to database connection strings:
envVars:
- key: DATABASE_URL
fromDatabase:
name: postgres
property: connectionString
- key: REDIS_URL
fromDatabase:
name: redis
property: connectionStringAvailable properties:
connectionString: Full connection URLhost: Database hostport: Database portuser: Database usernamepassword: Database passworddatabase: Database namehostport: Combined host:portLink to other services:
envVars:
- key: API_URL
fromService:
name: api-server
type: web
property: hostReusable groups shared across services:
envVarGroups:
- name: shared-config
envVars:
- key: LOG_LEVEL
value: info
- key: ENVIRONMENT
value: production
services:
- type: web
name: web-app
runtime: node
envVars:
- fromGroup: shared-config
- key: PORT
value: 10000databases:
- name: postgres
databaseName: myapp_prod
user: myapp_user
plan: free
postgresMajorVersion: "15"
ipAllowList: []Plans:
free: 1 GB storage, 97 MB RAM, 0.1 CPUbasic-256mb, basic-512mb, basic-1gb, basic-4gbpro-4gb, pro-8gb, pro-16gb, etc.accelerated-4gb, accelerated-8gb, etc. (SSD-backed)Key fields:
name: Identifier for referencesdatabaseName: Actual PostgreSQL database nameuser: Database usernamepostgresMajorVersion: PostgreSQL version (11-16)ipAllowList: Array of CIDR blocks (empty = internal only)diskSizeGB: Storage size (paid plans only)High Availability (paid plans):
databases:
- name: postgres
databaseName: myapp_prod
plan: pro-4gb
highAvailabilityEnabled: trueRead Replicas (paid plans):
databases:
- name: postgres
databaseName: myapp_prod
plan: pro-4gb
readReplicas:
- name: read-replica-1
region: ohio
- name: read-replica-2
region: frankfurtdatabases:
- name: redis
plan: free
maxmemoryPolicy: allkeys-lru
ipAllowList: []Plans: Same as PostgreSQL
maxmemoryPolicy options:
allkeys-lru: Evict least recently used keysvolatile-lru: Evict LRU keys with TTLallkeys-random: Evict random keysvolatile-random: Evict random keys with TTLvolatile-ttl: Evict keys with soonest TTLnoeviction: Return errors when memory fullFixed number of instances:
services:
- type: web
name: my-app
runtime: node
plan: standard
numInstances: 3Dynamic scaling based on CPU/memory (Professional workspace required):
services:
- type: web
name: my-app
runtime: node
plan: standard
scaling:
minInstances: 1
maxInstances: 5
targetCPUPercent: 60
targetMemoryPercent: 70Notes:
minInstances countConfigure health check endpoints:
services:
- type: web
name: my-app
runtime: node
healthCheckPath: /healthDefault: / (root path)
Recommended: Add a dedicated /health endpoint that returns 200 OK.
Control when builds are triggered based on changed files:
services:
- type: web
name: frontend
runtime: static
buildFilter:
paths:
- frontend/**
ignoredPaths:
- frontend/README.md
- frontend/**/*.test.jsBehavior:
paths specified: Build only when files in those paths changeignoredPaths specified: Don’t build when only ignored files changeOrganize services into projects with multiple environments:
projects:
- name: my-application
environments:
- name: production
services:
- type: web
name: prod-api
runtime: node
plan: pro
buildCommand: npm ci
startCommand: npm start
databases:
- name: prod-postgres
plan: pro-4gb
networking:
isolation: enabled
permissions:
protection: enabled
- name: staging
services:
- type: web
name: staging-api
runtime: node
plan: starter
buildCommand: npm ci
startCommand: npm start
databases:
- name: staging-postgres
plan: freeEnvironment features:
networking.isolation: Enable network isolation between environmentspermissions.protection: Require approval for environment changesConfigure automatic preview environments for pull requests:
previews:
generation: auto_preview # auto_preview | manual | noneOptions:
auto_preview: Create preview environment for each PR automaticallymanual: User manually triggers preview creationnone: Disable preview environmentsFull-featured Blueprint with multiple services and databases:
services:
# Web service
- type: web
name: web-app
runtime: node
plan: free
region: oregon
buildCommand: npm ci && npm run build
startCommand: npm start
branch: main
autoDeploy: true
healthCheckPath: /health
envVars:
- key: NODE_ENV
value: production
- key: DATABASE_URL
fromDatabase:
name: postgres
property: connectionString
- key: REDIS_URL
fromDatabase:
name: redis
property: connectionString
- key: JWT_SECRET
sync: false
# Background worker
- type: worker
name: queue-worker
runtime: node
plan: free
buildCommand: npm ci
startCommand: node worker.js
envVars:
- key: REDIS_URL
fromDatabase:
name: redis
property: connectionString
# Cron job
- type: cron
name: daily-cleanup
runtime: node
schedule: "0 3 * * *"
buildCommand: npm ci
startCommand: node scripts/cleanup.js
envVars:
- key: DATABASE_URL
fromDatabase:
name: postgres
property: connectionString
# Static frontend
- type: web
name: frontend
runtime: static
buildCommand: npm ci && npm run build
staticPublishPath: ./dist
routes:
- type: rewrite
source: /*
destination: /index.html
databases:
- name: postgres
databaseName: app_production
user: app_user
plan: free
postgresMajorVersion: "15"
ipAllowList: []
- name: redis
plan: free
maxmemoryPolicy: allkeys-lru
ipAllowList: []Validate your Blueprint before deploying (when CLI command is available):
render blueprint validateCommon validation errors:
plan: free by default - Let users upgrade if neededsync: false - Never hardcode sensitive valuesfromDatabase for database URLs - Automatic internal connection strings0.0.0.0:$PORT - Required for web services