Stack template¶
Custom stacks imported from Git are defined by stack.yml.
If a repository contains multiple stacks, list their directories in index.yml:
stacks:
- php
- node
Each listed directory must contain its own stack.yml. Paths used by services[].configs[].config are resolved relative to that stack directory.
Only the fields documented on this page are supported. Unknown fields will be rejected during import.
Example¶
name: php
title: PHP
icon: php
category: runtimes
env:
- name: APP_TYPE
value: php
tokens:
- name: app_secret
generate:
regex: '[0-9a-z]{32}'
annotations:
- name: prometheus.io/scrape
value: "true"
helm:
- name: imagePullSecrets
value:
- registry-creds
services:
- name: php
title: PHP
service: php:8.3
required: true
options:
- version: '8.3'
default: true
env:
- name: PHP_FPM_PM_MAX_CHILDREN
value: "8"
tokens:
- name: xdebug_ide_key
value: phpstorm
workloads:
- name: main
containers:
- name: php
env:
- name: APP_ENV
value: prod
resources:
request:
cpu: 100
memory: 128
limit:
cpu: 500
memory: 512
cron:
- name: queue
title: Queue runner
command: php /var/www/html/artisan schedule:run
schedule: "0 * * * *"
configs:
- name: php_ini
config: configs/php.ini
derivatives:
- name: php-xhprof
service: xhprof
env:
- name: XHGUI_HOST
value: http://xhgui
- name: nginx
title: Nginx
service: php-nginx
serviceRevPinned: true
required: true
depends:
- php
workloads:
- name: main
containers:
- name: nginx
env:
- name: NGINX_VHOST_PRESET
value: php
links:
- name: backend
service: php
- name: mariadb
title: MariaDB
service: mariadb:11
disabled: true
volumes:
- name: data
size: 20
Top-Level Fields¶
name¶
Type: string. Required.
Stack machine name. Use a lowercase slug with letters, numbers, and dashes.
It must follow the general Kubernetes name rules.
title¶
Type: string. Required.
Human-readable stack title.
icon¶
Type: string.
Icon name shown in the Wodby dashboard.
docs¶
Type: string. Optional.
HTTPS address of a guide to the stack: how its services work together, which optional services to enable, and what the application's code must do. AI agents that work on an app environment created from the stack, such as Wodby Agent, get the address and read the guide before changing how the application is set up. A copy of the stack in another organization or project uses the guide of the stack it was copied from.
docs: https://wodby.com/docs/2.0/stacks/catalog/go/
variantOf¶
Type: string. Optional.
Name of the main stack this stack is a variant of. Use it for stacks that run the same application in a different way,
for example a stack that builds Matomo from your repository next to a stack that runs the prebuilt Matomo image. The
stack page in the dashboard lists the other variants under Other variants of this stack, so people can find the one
that fits.
- The main stack must belong to the same organization.
- The main stack can't be a variant itself, and a stack that has variants can't become one.
- The main stack can be imported later. The variants appear once both stacks exist.
- A copy of the stack, for example one added from the catalog, is not a variant.
name: matomo-buildable
title: Matomo (buildable)
variantOf: matomo
variant¶
Type: string. Optional. Requires variantOf.
Short label that tells this variant apart, such as Buildable. Up to 64 characters.
variantDescription¶
Type: string. Optional.
When to choose this stack over its other variants. The stack page shows it under the link to this stack on the other
variants' pages. Up to 500 characters. The main stack can have one too, without variantOf.
variantDescription: >-
Choose this when you want to customize Matomo: pin the Matomo version and add
your own plugins in a Git repository, and Wodby builds Matomo from it.
category¶
Type: string. Optional.
Catalog category of the stack. The stack catalog in the dashboard can be filtered by category, and a catalog stack's page suggests other stacks of the same category. A copy of the stack, for example one added from the catalog, keeps its category. Variants are listed in the catalog under their category but aren't suggested on other stacks' pages.
| Value | Category in the dashboard |
|---|---|
javascript |
JavaScript frameworks |
frameworks |
Backend frameworks |
runtimes |
Language runtimes |
cms |
CMS & publishing |
databases |
Databases |
datastores |
Datastores & messaging |
search |
Search & indexing |
observability |
Observability |
data |
Data & automation |
ai |
AI |
devtools |
Developer platforms |
collaboration |
Business apps |
networking |
Networking & identity |
platform |
Email & platform services |
Any other value is rejected during import.
category: cms
access¶
Type: object.
Optional Private App Access requirement for app environments created from the stack. This policy describes the access outcome the stack needs. The actual access configuration is set on each app environment, where the user selects an eligible Private App Access integration.
required: required boolean. Whentrue, Private App Access must be configured during app creation and cannot be removed while the app environment uses this stack revision.provider: optional provider machine name, such astailscaleorcloudflare. Omit it to accept any provider that supports the required mode and scope. Set it only when the stack depends on provider-specific behavior.mode: required access type. Allowed values areprotectedandprivate_network.scope: required access scope. Allowed values areentire_appandselected_endpoints.
For example, a stack that must be private but works with either Tailscale or Cloudflare can use a provider-neutral policy:
access:
required: true
mode: private_network
scope: entire_app
Existing stack revisions that specify provider remain provider-specific.
services¶
Type: array. Required. Must contain at least one item.
List of stack services. Each item references an existing service and can apply stack-level overrides to it.
env¶
Type: array.
Stack-wide environment variables. They are applied to app services created from this stack.
Stack environment variables are runtime-only. They are not passed to Docker image builds. See the environment-variable naming and reserved-name rules.
tokens¶
Type: array.
Stack-wide tokens. Tokens can either store a fixed value or generate one from a regular expression. A stack-wide token overrides a service-defined token with the same name and environment type.
annotations¶
Type: array.
Stack-wide annotations applied to deployed app services where the service template maps annotations into Kubernetes resources. Use app endpoint route settings for HTTP routing behavior.
helm¶
Type: array.
Stack-wide Helm values. Use this to override values required by the service Helm integration.
Shared Value Objects¶
env[]¶
Used by top-level env, services[].env, and services[].workloads[].containers[].env.
name: required environment variable name.value: required string value. Use quoted strings in YAML.secret: optional boolean. Whentrue, the value is stored as a secret.envType: optional environment type filter. Allowed values:prod,dev,staging,test,feature.
The environment-variable naming and reserved-name rules apply to top-level stack variables, stack-service variables, and container-scoped stack variables.
Stack env vars do not support build scope. Use a build-scoped service setting, service env var, or app-service env var when a Dockerfile needs a build argument.
tokens[]¶
Used by top-level tokens and services[].tokens.
name: required token name. Names that start withwodby_are reserved; see token names.value: fixed token value.generate.regex: regex used to generate the token value.secret: optional boolean for fixed-value tokens.envType: optional environment type filter.
Exactly one of value or generate.regex must be specified. Regex tokens are always secret regardless of the secret setting.
Within one token scope, each name and envType pair must be unique. You can define the same token name more than once
only when each definition has a different envType.
annotations[]¶
Used by top-level annotations.
name: required annotation name.value: required annotation value.envType: optional environment type filter.
Annotations are Kubernetes resource annotations. They are separate from app endpoint route settings.
helm[]¶
Used by top-level helm, services[].helm, and services[].derivatives[].helm.
name: required Helm values path.value: required value. Can be a scalar, array, or object.secret: optional boolean. Whentrue, the value is stored as a secret.envType: optional environment type filter.
Service Fields¶
services[].name¶
Type: string. Required.
Stack service machine name. It must be unique within the stack, including derivative stack services.
It must follow the Kubernetes service name rules: lowercase letters, numbers, and dashes only; start with a letter; end with a letter or number; 63 characters or shorter.
services[].title¶
Type: string. Required.
Human-readable service title shown in the stack and app UI.
services[].service¶
Type: string. Required.
Reference to an existing service. You can use either a plain service name such as php or a versioned reference such as php:8.3.
The referenced service must exist and be available to your organization.
Versioned references pin the stack service to the service revision that matches the requested service version. Stack service revision updates skip pinned services. Use an unversioned reference when the stack service should move to newer service revisions through manual or automatic stack service revision updates.
services[].serviceRevPinned¶
Type: boolean. Default: false.
Pins the stack service to the service revision selected during import. This is useful when the service reference is
unversioned but the stack should still keep the current service revision until you update the stack template or unpin
the service in the dashboard.
Derivative stack services inherit the pin state from their parent stack service.
services[].required¶
Type: boolean. Default: false.
Marks the service as mandatory when a new app is created from the stack.
A required stack service cannot be disabled.
services[].disabled¶
Type: boolean. Default: false.
Disables the stack service by default.
services[].replicas¶
Type: integer. Default: 1.
Default number of replicas for the stack service. Fixed service revisions accept 0 or 1; service revisions that
support horizontal scaling can use higher values.
services[].deployment¶
Type: object.
Service-wide deployment overrides for every app created from this stack revision. Each property overrides the matching service-manifest default independently.
The object supports:
strategymaxUnavailablemaxSurgeminReadyprogressDeadlineshutdownGracePeriod
For field formats, workload-kind restrictions, and precedence, see Deployment configuration.
services[].main¶
Type: boolean.
Marks the main service in the stack. Only one stack service can be main, and its main endpoint must expose a public HTTP
port. A port the stack makes private with services[].endpoints doesn't count. The corresponding app service owns the app environment's root technical route. This is independent of the
app environment's canonical Main route.
If no service is marked as main, Wodby will automatically pick the first eligible service. The same fallback applies when a stack without a main service later gains an eligible service through the dashboard or Git sync. If the stack has no eligible services, no main service is required.
services[].depends¶
Type: array[string].
List of stack service names that this service depends on. Every referenced name must exist in the same stack.
This affects deployment order: a service is deployed after its dependencies and deleted before them.
Wodby also derives deploy-time ordering from the current service links in an app environment. Use depends when you need
explicit ordering even when no link exists between the services.
The combined graph formed by depends entries and service links must be acyclic. This also applies to disabled services,
so enabling a service cannot expose a dependency cycle later.
services[].options¶
Type: array.
Limits which options from the referenced service can be used in this stack and sets the default option.
Each item supports:
version: required option version from the referenced service.default: optional boolean.
If no option is marked as default, the first listed option becomes the default automatically.
services[].env¶
Type: array.
Service-specific environment variables.
See the environment-variable naming and reserved-name rules.
services[].helm¶
Type: array.
Service-specific Helm values.
services[].workloads¶
Type: array.
Per-workload overrides for workloads defined by the referenced service.
Each item supports:
name: required workload name from the referenced service manifest. It must follow the general Kubernetes name rules.deployment: optional deployment override for this workload. It supports the same fields asservices[].deployment.containers: optional list of container overrides for that workload.
Each workload override must contain deployment, containers, or both.
Each services[].workloads[].containers[] item supports:
name: required container name from the referenced service manifest. It must follow the general Kubernetes name rules.env: optional container-specific environment variables.resources: optional resource overrides. Each value overrides only the service's default for that value; the values you leave out keep the service's defaults.
resources supports:
preset: name of a Wodby resource preset, such assmallorlarge. Its values fill in the four values below that you leave out, and the values you write override it. Custom presets of an organization can't be used in manifests.request.cpurequest.memorylimit.cpulimit.memory
CPU values are in millicores (1000 is one core) and must be multiples of 10. Memory values are in MiB and must be
multiples of 16.
Use the same workload names and container names declared by the referenced service. You only need to list the workloads and containers you want to override. Stack import validates these targets against the referenced service manifest.
services[].volumes¶
Type: array.
Overrides sizes for volumes defined by the referenced service.
Each item supports:
name: required service volume name. It must follow the general Kubernetes name rules.size: required size in GB, minimum1.
services[].endpoints¶
Type: array.
Keeps ports of the referenced service private in this stack's app environments. A private port gets no domain, no certificate, and no public port. Services in the same app environment still reach it by service name and port.
Use it when a service is public by default but this stack only needs it on the app environment's private network, for example an OpenTelemetry Collector that only the stack's own services send to.
Each item supports:
name: required name of an endpoint of the referenced service.ports: required list of ports, each with:name: required name of a port of that endpoint.private: required, must betrue.
services:
- name: otel-collector
title: OpenTelemetry Collector
service: opentelemetry-collector
endpoints:
- name: otlp
ports:
- name: otlp-http
private: true
A stack can only make a public port private. It can't publish a port that the service keeps private. Validation fails
when the endpoint or port doesn't exist in the service's endpoints, or when the
port uses routeToPublicPort. The main service's public HTTP port on its main endpoint can't be made private, because
it serves the app environment's root technical route. Derivatives keep the ports their service defines.
When an app environment is upgraded to a stack revision that makes a port private, Wodby removes the port's technical routes and closes its public port. A custom domain on that port stops the upgrade; remove the domain first.
services[].links¶
Type: array.
Links a stack service to another stack service to satisfy links defined by the referenced service.
Each item supports:
name: required service-defined link name.service: required target stack service name.
Required service links must be satisfied in the stack definition.
The link mapping remains part of the stack configuration when the source service is disabled. An enabled source service cannot have a disabled target for a required link; both source and target may be disabled. Stack drafts can temporarily omit required mappings while being edited, but they cannot be published or used to create or upgrade an app until all required links are valid.
When both linked services are part of the same app deployment, Wodby deploys the linked target service first. App-level link overrides can change that order for a specific app environment. A link override cannot introduce a dependency cycle.
services[].cron¶
Type: array.
Additional cron schedules for the stack service.
Each item supports:
name: required schedule name.title: required human-readable title.command: required command to run.schedule: required cron schedule.
Use standard five-field crontab syntax such as 0 * * * *. Cron schedules cannot run more often than once per hour.
services[].configs¶
Type: array.
Provides stack-specific file contents for configs defined by the referenced service.
Each item supports:
name: required config name from the referenced service. It must follow the general Kubernetes name rules.config: required file path relative to the stack directory.disabled: optional boolean.
The stack override only replaces the config content or disables the config. The delivery target (helm, filepath, or
filename) is still defined by the referenced service template.
services[].tokens¶
Type: array.
Service-specific tokens. The object shape is the same as top-level tokens. A service-specific token overrides both
service-defined and stack-wide tokens with the same name and environment type.
services[].derivatives¶
Type: array.
Overrides derivative services declared by the referenced service.
Each item supports:
name: required stack service name for the derivative service.service: required derivative name from the referenced service.required: optional boolean.env: optional environment variables.helm: optional Helm values.deployment: optional service-wide deployment overrides.workloads: optional workload-specific deployment and container overrides, with the same shape asservices[].workloads.
Only derivatives declared by the referenced service can be used here. Derivative stack service names follow the same
Kubernetes service name rules as services[].name.
If the referenced service inherits derivatives from another service, use the rewritten derivative name in service. For
example, if drupal11-php inherits php-sshd from php, the stack derivative should reference
service: drupal11-php-sshd. The name can still be a stack-local alias such as sshd.