Configuration as Code
Reference for porter.yaml
The following is a full reference for all the fields that can be set in a porter.yaml
file.
- version - the version of the
porter.yaml
file. The below documentation is forv2
. - name - the name of the app.
- services - a list of services for this app.
- name - the unique ID of the resource.
- type - the type of service - being one of
web
,worker
, orjob
. - run - the run command for the service.
- instances - the number of instances of the service to run.
- cpuCores - the number of CPU cores to allocate to the service.
- ramMegabytes - the amount of RAM to allocate to the service.
- gpuCoresNvidia - the number of Nvidia GPU cores to allocate to the service.
- port - the port that the service will listen on.
- additional type-specific fields. See full reference for web, worker, and job services.
- build - the build settings for the app. Only one of
build
orimage
can be set.- method - the build method for the app. Can be one of
docker
orpack
. - context - the build context for the app.
- dockerfile - the path to the Dockerfile for the app, if the method is
docker
. - builder - the builder image to use for the app, if the method is
pack
. - buildpacks - the buildpacks to use for the app, if the method is
pack
.
- method - the build method for the app. Can be one of
- image - the image settings for the app. Only one of
build
orimage
can be set.- repository - the image repository.
- tag - the image tag.
- env - the environment variables for the app.
- predeploy - the pre-deploy job for the app.
- run - the run command for the pre-deploy job.
- autoRollback - the auto-rollback settings for the app.
- enabled - whether auto-rollback is enabled.
version
string
- required
name
string
- optional
Either name
must or the PORTER_APP_NAME
environment variable must be set when running porter apply
.
services
array
- required
build
object
- optional
image
object
- optional
env
object
- optional
predeploy
object
- optional
autoRollback
object
- optional
When this attribute is enabled, Porter will automatically rollback all services in the app to the latest previously successfully-deployed version if the any service of the new version fails to deploy.