Skip to content

Infraspec Reference

Complete field reference for infraspec.yaml.

Top-Level Fields

FieldTypeRequiredDescription
namestringyesApp identifier (used as Nomad job ID, Consul service prefix)
deployboolnoSet false to disable deploys for this app
repoRepoSpecnoGit repository configuration
buildBuildSpecnoDocker build configuration
processesmap[string]ProcessyesNamed process definitions
servicesstring[]noLegacy service list (v1 compat)
secretsstring[]noExpected secret key names
migrationsstringnoPath to migrations directory (relative to repo root)
envmap[string]stringnoStatic environment variables
infrastructureInfrastructurenoBacking service declarations
endpointsEndpoint[]noExternal URL mappings
volumesVolumeSpec[]noHost volume mounts

Process

Each key in the processes map is the process name. The process type is inferred from which fields are set.

FieldTypeDefaultDescription
portintListen port (makes this a service process)
commandstringOverride the Docker CMD
schedulestringCron expression (makes this a periodic batch job)
functionFunctionSpecFunction configuration (makes this a batch job)
healthHealthSpecHTTP health check (only for processes with a port)
scalingScalingInstance count and autoscaling
drainDrainGraceful shutdown configuration
resourcesResourcescpu: 100, memory: 128CPU (MHz) and memory (MB) limits

Health

FieldTypeDefaultDescription
pathstringHTTP health check path (e.g. /health)
intervalstring10sCheck interval (Go duration)
timeoutstring5sCheck timeout (Go duration)

Scaling

FieldTypeDefaultDescription
minint1Minimum instance count
maxintMaximum instance count (for autoscaling)
per_regionintInstances per region
autoAutoScaleAutoscaling configuration

AutoScale

FieldTypeDescription
metricstringScaling metric: cpu, memory, kafka_lag, custom
targetintTarget value for the metric
topicstringKafka topic (required when metric is kafka_lag)

Drain

FieldTypeDefaultDescription
signalstringSIGTERMSignal sent to the process on shutdown
timeoutstringTime to wait after signal before force-killing

Resources

FieldTypeDefaultDescription
cpuint100CPU allocation in MHz
memoryint128Memory allocation in MB

FunctionSpec

FieldTypeDefaultDescription
timeoutstringMaximum execution time (Go duration)
memoryintMemory override in MB (takes precedence over resources.memory)

Repo

FieldTypeDefaultDescription
urlstringGit clone URL
branchstringmainDefault branch
autoDeployboolfalseAuto-deploy on webhook push
repoWebstringWeb URL for the repo (used in UI links)

Build

FieldTypeDefaultDescription
dockerfilestringDockerfilePath to Dockerfile
teststringTest command (runs before deploy, fails pipeline on error)

Infrastructure

FieldTypeDescription
postgres.databasestringDatabase name for snapshots, migrations, and DATABASE_URL
redis.namespacestringRedis key namespace
kafka.topicsstring[]Kafka topics to declare
nats.streamsstring[]NATS JetStream stream names

Endpoints

FieldTypeDescription
urlstringExternal hostname (maps to cloudflared ingress rule)
regionstringOptional region hint

Volumes

FieldTypeDefaultDescription
namestringNomad host volume name
mountstringMount path inside the container
readOnlyboolfalseMount as read-only

Defaults Summary

SettingDefault Value
resources.cpu100 MHz
resources.memory128 MB
health.interval10s
health.timeout5s
scaling.min1
repo.branchmain

Full Example

A real-world infraspec for an app with a web process, background worker, cron job, and database:

yaml
name: signal-sideband

repo:
  url: git@github.com:antiartificial/signal-sideband.git
  branch: master
  autoDeploy: true
  repoWeb: https://github.com/antiartificial/signal-sideband

build:
  dockerfile: Dockerfile
  test: go test ./...

processes:
  web:
    port: 8080
    command: ./signal-sideband
    health:
      path: /health
    scaling:
      min: 1
    resources:
      cpu: 200
      memory: 256
  poller:
    command: ./signal-sideband --mode=poller
    resources:
      cpu: 100
      memory: 128
  digest:
    schedule: "0 8 * * *"
    command: ./signal-sideband --mode=digest

secrets:
  - DATABASE_URL
  - OPENAI_API_KEY
  - FILTER_GROUP_ID

migrations: ./migrations

env:
  LOG_LEVEL: info
  TZ: America/New_York

infrastructure:
  postgres:
    database: signal_sideband

endpoints:
  - url: signal.example.com

volumes:
  - name: signal-data
    mount: /var/lib/signal-cli