services
Background Worker
Run long-lived processes that do not serve HTTP traffic.
A background worker is a long-running process that does not receive HTTP requests. Use it for job processors, queue consumers, data pipelines, and any work that runs continuously in the background.
When to Use#
- Job queue processors (Sidekiq, Celery, BullMQ)
- Message consumers (Kafka, RabbitMQ)
- Data pipelines and ETL processes
- Monitoring agents or scrapers
Configuration#
runix.yaml
yaml
services:
- name: worker
type: background-worker
repo: https://github.com/alice/job-processor
instance: standard
env:
DATABASE_URL: "${db.connection_string}"
REDIS_URL: "${cache.connection_string}"Available Fields#
| Field | Default | Description |
|---|---|---|
| `repo` | — | GitHub repository URL (required) |
| `branch` | `main` | Git branch to deploy |
| `instance` | `starter` | Instance type |
| `build_command` | Auto-detected | Override the build command |
| `start_command` | Auto-detected | Override the start command |
| `env` | None | Environment variables |
Key Differences from Web Services#
- No public URL is assigned — the worker is not reachable from the internet
- No health check path — the container is considered healthy as long as the process is running
- If the process exits, the container restarts automatically
Background workers can still connect to other services using internal networking or connection strings from database services.