You can deploy multiple Porter apps alongside multiple Porter addons in a single porter.yaml file. This is particularly useful when you need to deploy related services that work together, such as a web application with its associated database or cache.
This feature is in development and is subject to change.
Usage
To enable this feature, set the PORTER_ADDON_YAML environment variable while running the apply command.
PORTER_ADDON_YAML=true porter apply -f porter.yaml
Example Configuration
apps:
- version: v2
name: backend
services:
- name: server
run: ""
type: web
instances: 1
cpuCores: 0.2
ramMegabytes: 100
terminationGracePeriodSeconds: 30
port: 80
sleep: false
private: true
envGroups: # Environment groups can be used to inject environment variables from the addons into the service.
- cache
- db
image:
repository: nginx
tag: latest
- version: v2
name: frontend
services:
- name: dashboard
run: ""
type: web
instances: 1
cpuCores: 0.2
ramMegabytes: 100
terminationGracePeriodSeconds: 30
port: 80
sleep: false
private: true
envGroups:
- cache
- db
image:
repository: nginx
tag: latest
- version: v2
name: api
services:
- name: worker
run: ""
type: worker
instances: 1
cpuCores: 0.2
ramMegabytes: 100
terminationGracePeriodSeconds: 30
port: 80
sleep: false
envGroups:
- cache
- db
image:
repository: nginx
tag: latest
addons:
- name: cache
type: MANAGED-REDIS
engine: REDIS
values:
config:
name: cache
masterUserPassword: password
cpuCores: 0.1
ramMegabytes: 110
storageGigabytes: 2 # Persistent storage size in GB.
- name: db
type: MANAGED-POSTGRES
engine: POSTGRES
values:
config:
name: db
masterUserPassword: password
cpuCores: 0.1
ramMegabytes: 110
storageGigabytes: 2
Resource configuration
Managed Postgres and Redis addons accept the following resource fields under values.config:
| Field | Type | Description | UI range |
|---|
cpuCores | number | CPU allocation for the addon (e.g. 0.1, 0.5, 1). | Bounded by the cluster node size. |
ramMegabytes | integer | Memory allocation in megabytes. | Bounded by the cluster node size. |
storageGigabytes | integer | Persistent storage size in GB. | 1–100 GB. |
You can also edit these values from the Resources tab of the Postgres or Redis addon in the Porter dashboard, which exposes CPU, RAM, and Storage sliders.
The dashboard sliders clamp storageGigabytes at 100 GB. To allocate more, set the value directly in porter.yaml — values above 100 declared in YAML are preserved as-is and are not silently clamped.