zerops.yaml configuration file.
Not all parameters are available for every service type. Most parameters work across different runtime services, but some are specific to certain service types (e.g., documentRoot for webserver services, routing for Static services).
File Structure
Top-Level Configuration
setup
The hostname of your service. Must match an existing service in your Zerops project.
extends
Inherit configuration from another service defined in the same How it works:
zerops.yaml file. Useful for environment-specific configurations.- The
extendsvalue must refer to another service’ssetupvalue - Child service inherits all configuration from the base service
- Configuration is merged at the section level (
build,run,deploy) - You can override specific sections by redefining them
Build Configuration
Thebuild section defines how your application should be built before deployment.
base
Sets the base technology for the build environment. See available base technologies.You can specify multiple technologies:
os
Sets the operating system for the build environment.Options:
alpine(default)ubuntu
prepareCommands
Commands to customize the build environment by installing additional dependencies or tools.
buildCommands
Commands to build your application.Run commands in a single shell instance:
deployFiles
Files or folders to deploy after a successful build. Files are placed in Using wildcards:The Using .deployignore:Add a
/var/www in the runtime container.~ character acts as a wildcard for one or more folders:.deployignore file to your project root to exclude files during deployment. Uses the same pattern format as .gitignore..deployignore
cache
Files or folders to cache for subsequent builds.For detailed information, see the build cache guide.
addToRunPrepare
Files or folders to copy from the build container to the prepare runtime container.
envVariables
Environment variables for the build environment.
The
yamlPreprocessor option in your import YAML allows you to generate random values and keys. See yamlPreprocessor.Deploy Configuration
Thedeploy section controls deployment behavior.
temporaryShutdown
Controls the container replacement order during deployment.
false(default): New containers start before old containers are removed (zero-downtime)true: Old containers are removed before new containers start (temporary downtime, fewer resources)
readinessCheck
Defines a readiness check to verify if a new deployment is ready to receive traffic. Requires either
httpGet or exec.readinessCheck.httpGet
Configure HTTP GET health check.Parameters:
port(required) - Port number for the HTTP requestpath(required) - URL path for the HTTP requesthost- Host header for the request (default: localhost)scheme- HTTP or HTTPS (default: HTTP)
readinessCheck.exec
Configure command-based health check.Parameters:
command(required) - Shell command to execute
readinessCheck.failureTimeout
Time in seconds until container is marked as failed.
readinessCheck.retryPeriod
Time interval in seconds between readiness check attempts.
Runtime Configuration
Therun section defines how your application runs in production.
base
Sets the base technology for the runtime environment. If not specified, the current version is maintained.
os
Sets the operating system for the runtime environment. Same options as build.os.
ports
Internal ports on which your application will listen.
ports[].port
Port number between 10 and 65435.
ports[].protocol
Network protocol:
TCP or UDPports[].httpSupport
Set to
true if a web server is running on this port. Only available with TCP protocol.prepareCommands
Commands to customize the runtime environment.
initCommands
Commands to run each time a runtime container starts or restarts.
start
Start command for your application. Either
start or startCommands is required.startCommands
Define multiple start commands that run their own processes.See start-commands-example for more details.
documentRoot
Root folder for publicly accessible web server content. Available only for webserver runtimes.
siteConfigPath
Path to custom webserver configuration. Available only for webserver runtimes.
envVariables
Environment variables for the runtime environment.
envReplace
Automatically replace environment variable placeholders in static files during deployment.
envReplace.delimiter
Characters that wrap variable names in placeholders (e.g.,
%% means %%VARIABLE%%).Supports multiple delimiters:envReplace.target
Files or directories to process for variable replacement.Example:File content before:Environment variable:The placeholder gets replaced with the actual value during deployment.
routing
Configure URL routing, redirects, and HTTP headers. Only for Static services.
routing.root
Custom root directory for the service.
routing.cors
Enable CORS headers for cross-origin requests.
Special case:
"*" is automatically converted to '*'routing.redirects
Define URL redirects and rewrites.Each redirect object supports:
from(required) - Source path to match (supports wildcards with*)to(required) - Destination pathstatus- HTTP status code (required for absolute URLs)preservePath- Preserve path after wildcard matchpreserveQuery- Preserve query parameters
routing.headers
Set custom HTTP headers for specific paths.Each header object supports:
for(required) - Path pattern to matchvalues(required) - Object with header name/value pairs
healthCheck
Define a health check for your running application.
healthCheck.httpGet
Configure HTTP GET health check.Parameters:
port(required) - Port numberpath(required) - URL pathhost- Host headerscheme- HTTP or HTTPS
healthCheck.exec
Configure command-based health check.Parameters:
command(required) - Shell command
healthCheck.failureTimeout
Time in seconds until container fails after consecutive health check failures.
healthCheck.disconnectTimeout
Time in seconds until container is disconnected and becomes publicly unavailable.
healthCheck.recoveryTimeout
Time in seconds until container is connected and becomes publicly available.
healthCheck.execPeriod
Time interval in seconds between health check attempts.
crontab
Define scheduled commands to run as cron jobs.Each cron job supports:
command(required) - Shell command to executetiming(required) - Cron format schedule (minute hour day month weekday)allContainers(required) - Run on all containers (true) or one (false)workingDir- Working directory (default: /var/www)
Complete Example
Here’s a comprehensive example showing multiple services with various configurations:Related Resources
Overview
Quick introduction to zerops.yaml
Base Technologies
Available runtime and build technologies
Cron Jobs
Schedule automated tasks
Build Cache
Optimize build times with caching