Configuration
systemg uses YAML files to define services and their relationships.Complete example
Configuration sections
version
Required. Specifies the configuration schema version.
env
Optional environment variables shared by all services.
services
Required. Defines the services to manage.
Service configuration
command
Required. The command to execute.
depends_on
Services that must start before this one.
env
Service-specific environment configuration.
restart_policy
Control how services recover from crashes.
always- Restart on any exiton-failure- Restart only on non-zero exit codesnever- Don’t restart
hooks
Run commands when services start or stop.
health_check
Verify services are ready before marking them healthy.
cron
Run services on a schedule instead of continuously.
deployment
Control how services update during restarts.
blue_green so traffic can be switched between two slots.
Field reference
Service fields
Primary keys available on each service definition.| Field | Type | Description |
|---|---|---|
command | string | Command to execute (required) |
depends_on | array | Services that must start first |
env | object | Environment configuration |
restart_policy | string | always, on-failure, or never |
backoff | string | Time between restart attempts |
max_restarts | number | Maximum restart attempts |
hooks | object | Lifecycle event handlers |
health_check | object | Service readiness probe |
cron | string | Cron schedule expression |
deployment | object | Update strategy configuration |
Environment object
Environment sources and inline overrides merged into the service process environment.| Field | Type | Description |
|---|---|---|
vars | object | Key-value environment variables |
file | string | Path to env file |
Hooks object
Lifecycle callbacks you can trigger on service start/stop/restart outcomes.| Field | Type | Description |
|---|---|---|
on_start | object | Commands for start events |
on_stop | object | Commands for stop events |
on_restart | object | Commands for restart events |
success and error handlers with:
command- Command to executetimeout- Maximum execution time
Health check object
Probe configuration used to determine readiness/health during deployment workflows.| Field | Type | Description |
|---|---|---|
command | string | Check command |
url | string | HTTP endpoint (alternative to command) |
interval | string | Time between checks |
timeout | string | Check timeout |
retries | number | Attempts before marking unhealthy |
Deployment object
Controls how restarts are performed and what validation happens before cutover.| Field | Type | Description |
|---|---|---|
strategy | string | rolling or immediate |
pre_start | string | Command to run before starting |
health_check | object | Health check configuration |
grace_period | string | Time before stopping old instance |
blue_green | object | Single-host blue/green rollout settings |
Blue/green deployment object
Single-host zero-downtime options for alternating between two rollout slots (typically ports).| Field | Type | Description |
|---|---|---|
env_var | string | Env var injected with slot value (PORT default) |
slots | array | Exactly two slot values to alternate between |
switch_command | string | Command to switch traffic to candidate slot |
candidate_health_check_url | string | Candidate health probe URL template ({slot} supported) |
switch_verify_url | string | Optional post-switch verify URL |
state_path | string | Optional persisted active-slot state file path |