Skip to Content
New to Genbox? Check out our Getting Started guide
Configurationgenbox.yaml Schema

genbox.yaml Schema

Complete reference for the genbox.yaml configuration file.

Version

version: 4

The schema version. Currently only version 4 is supported.

Project

Required project metadata:

project: name: myapp # Required: Project name description: My application # Optional: Description structure: monorepo # Required: Project structure

Structure Types

ValueDescription
single-appSingle application
monorepoMultiple apps in one repo
workspacepnpm/npm/yarn workspace
microservicesMultiple repos
hybridMix of structures

Apps

Define your applications:

apps: frontend: path: ./web # Required: Relative path type: frontend # Required: App type port: 3000 # Port (or $detect) framework: nextjs # Framework (or $detect) runner: pm2 # How to run: pm2, docker, node description: Customer website commands: # Build/run commands install: pnpm install dev: pnpm dev build: pnpm build start: pnpm start connects_to: # Dependencies api: mode: local # local, staging, production env: NEXT_PUBLIC_API_URL: http://localhost:3050 env: # Env var files to load - .env - .env.local

App Types

TypeDescription
frontendClient-side application
backendServer-side application
workerBackground worker
gatewayAPI gateway
libraryShared library (not runnable)
fullstackFull-stack application

Runners

RunnerDescription
pm2Process manager (default)
dockerVia docker-compose
nodeDirect node execution
bunBun runtime
noneNot runnable (library)

Provides (Infrastructure)

Define infrastructure services:

provides: mongodb: type: database image: mongo:7 port: 27017 data_dir: /data/db # Optional: Data directory env: # Container env vars MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: secret redis: type: cache image: redis:7-alpine port: 6379 rabbitmq: type: queue image: rabbitmq:3-management port: 5672 additional_ports: management: 15672

Infrastructure Types

TypeDescription
databaseDatabase service
cacheCaching service
queueMessage queue
storageObject storage
searchSearch engine
emailEmail service
customCustom service

Environments

Define external environment connections:

environments: staging: description: Staging environment urls: api: https://api.staging.example.com admin: https://admin.staging.example.com env: MONGODB_URI: ${STAGING_MONGODB_URI} production: description: Production (read-only) urls: api: https://api.example.com safety: read_only: true require_confirmation: true

Profiles

Define environment configurations:

profiles: quick: description: Frontend only, staging backend size: small apps: - frontend default_connection: staging full: description: Full stack with local DB extends: quick # Inherit from another profile size: large apps: - frontend - backend default_connection: local database: mode: copy source: staging exclude: - logs - sessions api-dev: description: Backend development size: medium apps: - backend connections: backend: mongodb: local redis: staging

Database Modes

ModeDescription
noneNo database
localEmpty local database
copyCopy from source environment
snapshotRestore from backup
remoteConnect to remote database

Server Sizes

SizevCPURAMCredits/Hour
small24 GB1
medium48 GB2
large816 GB4
xl1632 GB8

Defaults

Set default values:

defaults: size: medium branch: main database: mode: copy source: staging connection_mode: local install_claude_code: true inject_claude_auth: true

Hooks

Lifecycle hooks:

hooks: post_checkout: - command: pnpm install workdir: ${APP_PATH} post_create: - command: ./scripts/setup.sh run_as: root pre_start: - command: pnpm build workdir: /home/dev/myapp/web post_start: - command: docker-compose up -d workdir: /home/dev/myapp/api condition: apps.api pre_destroy: - command: ./scripts/cleanup.sh

Repos

Multi-repository configuration:

repos: main: url: git@github.com:org/main.git path: /home/dev/myapp branch: main apps: - frontend - backend shared: url: git@github.com:org/shared-libs.git path: /home/dev/shared branch: main git_auth: method: ssh # ssh or token ssh_key_path: ~/.ssh/id_rsa

Strict Mode

Enable strict validation:

strict: enabled: true allow_detect: true # Allow $detect markers warnings_as_errors: false # Treat warnings as errors

Complete Example

See the examples directory  for complete configuration examples.

Last updated on