Configuration

Complete reference for raidframe.yaml project configuration.

raidframe.yaml

The raidframe.yaml file defines your project's services, databases, and runtime configuration. Place it in your project root.

If you don't have one, RaidFrame auto-detects your stack and generates a default configuration on first deploy.

Generate Configuration

rf config generate
Detected: Node.js (Next.js 16)
Generated: raidframe.yaml

Services:  1 (web)
Database:  none (add with rf add postgres)
Region:    us-east-1

Full Example

project: my-saas
region: us-east-1

services:
  web:
    type: web
    build:
      dockerfile: Dockerfile
    port: 3000
    health_check:
      path: /api/health
      interval: 10s
      timeout: 5s
    scaling:
      min: 2
      max: 20
      target_cpu: 70
    resources:
      cpu: 2
      memory: 4GB
    domains:
      - myapp.com
      - www.myapp.com

  api:
    type: web
    build:
      context: ./services/api
      dockerfile: Dockerfile
    port: 8080
    scaling:
      min: 1
      max: 10

  worker:
    type: worker
    build:
      context: ./services/worker
    command: node worker.js
    scaling:
      min: 1
      max: 5
      target_queue_depth: 100

  cleanup:
    type: cron
    build:
      context: .
    command: node scripts/cleanup.js
    schedule: "0 3 * * *"

databases:
  main:
    engine: postgres
    version: "16"
    plan: pro
    extensions:
      - pgvector
      - pg_trgm

  cache:
    engine: redis
    version: "7.2"
    plan: standard
    maxmemory_policy: allkeys-lru

  embeddings:
    engine: vector
    plan: standard

storage:
  uploads:
    type: object
    public: true
    max_file_size: 50MB

queues:
  emails:
    type: queue
    max_retries: 3
    dead_letter: true

env:
  shared:
    NODE_ENV: production
    LOG_LEVEL: info
  production:
    STRIPE_KEY: "${secrets.STRIPE_LIVE_KEY}"
  staging:
    STRIPE_KEY: "${secrets.STRIPE_TEST_KEY}"

Service Configuration

build

FieldTypeDescription
dockerfilestringPath to Dockerfile (default: Dockerfile)
contextstringBuild context directory (default: .)
targetstringMulti-stage build target
argsmapBuild-time arguments

scaling

FieldTypeDescription
minintMinimum instances (default: 1)
maxintMaximum instances (default: 10)
target_cpuintCPU % to trigger scale-up (default: 70)
target_memoryintMemory % to trigger scale-up
target_rpsintRequests/sec per instance to trigger scale-up
target_queue_depthintQueue depth to trigger worker scale-up
cooldowndurationWait time before scale-down (default: 5m)
schedulemapTime-based scaling rules

resources

FieldTypeOptions
cpuint/stringshared, 1, 2, 4, 8, 16, 32
memorystring512MB, 1GB, 2GB, 4GB, 8GB, 16GB, 32GB, 64GB
gpustringt4, l40s, a100-40g, a100-80g

health_check

FieldTypeDescription
pathstringHTTP path to check (default: /)
portintPort to check (default: service port)
intervaldurationCheck interval (default: 10s)
timeoutdurationRequest timeout (default: 5s)
retriesintFailures before unhealthy (default: 3)
start_perioddurationGrace period after start (default: 30s)

Validate Configuration

rf config validate
✓ raidframe.yaml is valid
  Services: 4 (web: 2, worker: 1, cron: 1)
  Databases: 3 (postgres, redis, vector)
  Storage: 1 bucket
  Queues: 1

Environment Variable Interpolation

Reference secrets and other values in your config:

env:
  DATABASE_URL: "${databases.main.url}"
  REDIS_URL: "${databases.cache.url}"
  STORAGE_URL: "${storage.uploads.url}"
  API_KEY: "${secrets.API_KEY}"

Secrets are set via the CLI and never stored in your config file:

rf secrets set API_KEY=sk_live_xxx STRIPE_KEY=sk_live_yyy