zerops.yaml file in your repository root.
Basic zerops.yaml Structure
Here’s a complete example:Build Configuration
base
Required. Sets the Node.js version for the build environment.nodejs@18nodejs@20nodejs@22nodejs@latest
- Alpine Linux (latest)
- Selected Node.js version
- npm, yarn, git, and npx
- Zerops CLI (zsc)
Changing the base version invalidates your build cache.
os
Optional. Choose the operating system.alpine(default) - Alpine Linux 3.19ubuntu- Ubuntu 22.04
prepareCommands
Optional. Install additional dependencies before building.How prepare commands work
How prepare commands work
Zerops runs prepare commands in order before your build:
- Creates a build container
- Downloads your code to
/var/www - Runs prepare commands
- Proceeds to build commands
prepareCommands invalidates the cache.buildCommands
Optional. Define commands to build your application.- npm
- yarn
- pnpm
deployFiles
Required. Specify which files to deploy after a successful build.- Built app
- Source code
- Everything
Using Wildcards
Use~ as a wildcard:
.deployignore
Create a.deployignore file to exclude files:
.deployignore
cache
Optional. Cache files/folders for faster builds.Caching
node_modules can significantly speed up builds when dependencies don’t change.envVariables
Optional. Set environment variables for the build.Runtime Configuration
base
Optional. Set the Node.js version for runtime (defaults to build version).ports
Optional. Define which ports your app listens on.port- Port number (10-65435)protocol-TCP(default) orUDPhttpSupport- Enable HTTP routing (default: true for TCP)
Other services in your project can access your app using
hostname:port (e.g., app:3000).prepareCommands
Optional. Customize the runtime environment.initCommands
Optional. Run commands each time a container starts.start
Required. Command to start your application.envVariables
Optional. Set runtime environment variables.healthCheck
Optional. Configure health checks.- HTTP Check
- Command Check
Complete Example
Here’s a production-ready configuration:Next Steps
Deployment Process
Learn how deployments work in Zerops.
Scaling Configuration
Configure auto-scaling for your app.