Skip to main content

Blueprint Spec Reference

Complete reference for the railpush.yaml file format.

Root Fields

FieldTypeDescription
servicesArrayWeb services, workers, cron jobs, static sites
databasesArrayPostgreSQL database instances
keyValuesArrayRedis key-value stores
envVarGroupsArrayShared environment variable groups

Service Fields

FieldTypeRequiredDescription
nameStringYesUnique service name within the blueprint
typeStringNoweb (default), pserv, worker, cron, static
runtimeStringYes*node, python, go, ruby, rust, docker, elixir, static, image
repoStringNoRepository URL (defaults to blueprint repo)
branchStringNoGit branch (defaults to blueprint branch)
buildCommandStringNoBuild command
startCommandStringNoStart command (ignored for static sites)
dockerCommandStringNoDocker CMD override
dockerfilePathStringNoCustom Dockerfile path
dockerContextStringNoBuild context directory (alias: buildContext)
buildContextStringNoAlias for dockerContext (preferred for non-Docker builds)
rootDirStringNoRoot directory for monorepos
portIntNoHTTP port (default: 10000, web/pserv only)
planStringNofree, s (default), m, l
numInstancesIntNoInstance count (default: 1, 0 = suspended)
healthCheckPathStringNoHealth check endpoint (web/pserv only)
preDeployCommandStringNoRun before deploy (migrations, etc.)
staticPublishPathStringNoBuild output dir (required for static)
scheduleStringNoCron expression (required for cron)
autoDeployBoolNoAuto-deploy on push (default: true)
envVarsArrayNoEnvironment variables
domainsArrayNoCustom domain strings (web/static only)
diskObjectNoPersistent disk: { name, mountPath, sizeGB }
buildFilterObjectNoBuild triggers: { paths, ignoredPaths }
imageObjectNoPrebuilt image: { url }
buildIncludeArrayNoWhitelist files for build context (.dockerignore)
buildExcludeArrayNoExclude files from build context (.dockerignore)
baseImageStringNoOverride base image for auto-generated Dockerfile

Environment Variable Types

envVars examples
envVars:
# Static value
- key: NODE_ENV
value: production

# Auto-generated secret (32 chars)
- key: SECRET_KEY
generateValue: true

# Reference a database property
- key: DATABASE_URL
fromDatabase:
name: my-db
property: connectionString # or: host, port, user, password, database

# Reference another service
- key: API_HOST
fromService:
name: my-api
type: web
property: host # or: port, hostport, connectionString

# Copy an env var from another service
- key: SHARED_SECRET
fromService:
name: my-api
type: web
envVarKey: SECRET_KEY

# Import a shared env group
- fromGroup: shared-config

Database Fields

FieldTypeDescription
nameStringDatabase identifier (required, unique)
planStringfree (1Gi), s (5Gi), m (20Gi), l (100Gi). Default: s
postgresMajorVersionIntPostgreSQL version (default: 16)
databaseNameStringCustom DB name (defaults to resource name)
userStringCustom username (defaults to resource name)
initScriptStringInline SQL to run once on first provision (e.g. CREATE EXTENSION IF NOT EXISTS pgcrypto)
initScriptPathStringPath to a .sql file in the repo (relative to root). Read at sync time, run once on first provision.

Disk Configuration

disk example
services:
- type: web
name: my-app
runtime: node
disk:
name: data
mountPath: /var/data
sizeGB: 10

Image Deploy

image deploy
services:
- type: web
name: my-app
image:
url: docker.io/myorg/myapp:latest
port: 3000

Key-Value (Redis) Fields

FieldTypeDescription
nameStringRedis instance identifier (required, unique)
planStringfree (1Gi), s (2Gi), m (5Gi), l (10Gi). Default: s
maxmemoryPolicyStringRedis eviction policy (default: allkeys-lru)

Resource Limits by Size

SizeCPUMemoryPrice
free100m - 250m256Mi - 512Mi$0
s500m - 1512Mi - 1Gi$0.01/hr
m1 - 22Gi - 4Gi$0.02/hr
l2 - 44Gi - 8Gi$0.04/hr

Defaults Applied

FieldDefault
typeweb
port10000
plans
numInstances1
autoDeploytrue
disk.sizeGB10
postgresMajorVersion16
maxmemoryPolicyallkeys-lru

Build Filter

build filter example
services:
- type: web
name: my-api
runtime: node
buildFilter:
paths:
- src/**
- package.json
ignoredPaths:
- docs/**
- "*.md"

Per-Service Build Context (buildInclude / buildExclude)

Control which files each service sees during build. These fields accept comma-separated glob patterns in YAML array form. Patterns follow standard glob syntax (*, **, ?).

  • buildInclude Whitelist -- only matching files are included in the Docker build context. All other files are excluded via .dockerignore.
  • buildExclude Blacklist -- matching files are added to .dockerignore. All other files are included.

If both are set, buildInclude takes precedence. Useful for monorepos where multiple services share a directory.

buildInclude (whitelist)
services:
# Only include specific files in the build
- type: worker
name: sync-worker
runtime: python
buildInclude:
- worker.py
- requirements.txt
- schema.sql
- lib/** # glob: include entire lib directory
buildExclude (blacklist)
services:
# Exclude specific files from the build
- type: web
name: viewer
runtime: node
buildExclude:
- worker.py
- sync.log
- "*.md" # glob: exclude all markdown files
- "tests/**" # glob: exclude test directory

Custom Base Image (baseImage)

Override the default base image for Nixpacks auto-generated Dockerfiles. This is useful when your service needs multiple runtimes (e.g., Python + Node.js) or system libraries not in the default image. The baseImage replaces the FROM line in the generated Dockerfile.

Runtime compatibility

The base image must be compatible with your chosen runtime. For runtime: node, the image must have Node.js installed. For runtime: python, Python must be available. If using runtime: docker with a custom Dockerfile, baseImage is ignored.

baseImage example
services:
- type: web
name: fullstack-app
runtime: python
baseImage: nikolaik/python-nodejs:python3.12-nodejs20
buildCommand: pip install -r requirements.txt && npm install && npm run build
startCommand: uvicorn api:app --host 0.0.0.0 --port $PORT

Database Init Script

Run SQL once when a managed database is first provisioned. Use initScript for short inline SQL, or initScriptPath for a full schema file from the repo. Both can be used together (inline runs first).

inline SQL
databases:
- name: my-db
plan: s
initScript: CREATE EXTENSION IF NOT EXISTS pgcrypto;
SQL file from repo
databases:
- name: my-db
plan: s
initScriptPath: db/schema.sql