Deployment Flow
When you trigger a deployment, Zerops follows this process:Build Phase
- Creates a build container with your specified Node.js version
- Runs
prepareCommandsto set up the build environment - Executes
buildCommandsto build your application - Collects files specified in
deployFiles
Prepare Runtime
- Creates a runtime container (if needed)
- Runs runtime
prepareCommands(cached after first run) - Copies built files to
/var/www
Deploy
- Runs
initCommandson each container - Starts your application with the
startcommand - Performs readiness checks
- Routes traffic to healthy containers
Triggering Deployments
From Git Repository
Automatic deployment from Git:Configure Git integration
In the Zerops GUI:
- Navigate to your service
- Click Deploy
- Select From Git
- Enter repository URL and branch
Using zCLI
Deploy from your local machine:GitHub Actions
Automate deployments with GitHub Actions:.github/workflows/deploy.yml
Readiness Checks
Readiness checks ensure new containers are healthy before receiving traffic.HTTP Readiness Check
Check if your application responds to HTTP requests:How HTTP checks work
How HTTP checks work
Zerops repeatedly sends GET requests to
http://127.0.0.1:3000/health until:- The endpoint returns HTTP 200
- The timeout is reached (deployment fails)
/health endpoint should verify:- The server is running
- Database connections are ready
- Critical services are available
Command Readiness Check
Run a custom command to verify readiness:health-check.js
Zero-Downtime Deployments
Zerops ensures your application stays available during deployments:How It Works
- New containers start - Zerops creates new runtime containers with updated code
- Readiness checks - New containers must pass health checks
- Traffic shift - Load balancer routes traffic to new containers
- Graceful shutdown - Old containers finish existing requests before stopping
During deployment, both old and new versions may serve requests briefly. Ensure backwards compatibility.
Rolling Updates
With multiple containers, Zerops updates them progressively:- Update 1st container → health check → route traffic
- Update 2nd container → health check → route traffic
- Update 3rd container → health check → route traffic
- Continue until all containers updated
Deployment Logs
Monitor deployments in real-time:Build Log
View build progress:prepareCommandsoutputbuildCommandsexecution- Dependency installation
- Build errors and warnings
Runtime Log
Monitor application startup:- Container initialization
initCommandsoutput- Application start command
- Runtime errors
Access Logs
View logs in Zerops GUI:- Go to your service
- Click Logs
- Select log type (Build, Runtime, etc.)
- Filter by time range
Environment Variables in Deployment
Manage environment variables across deployments:Secret Variables
Set sensitive data in the GUI (not inzerops.yaml):
Build vs Runtime Variables
- Build Variables
- Runtime Variables
Available during build:
Referencing Secret Variables
Reference secrets set in GUI:Deployment Strategies
Blue-Green Deployment
Manually test before switching traffic:- Deploy to a new service
- Test using internal hostname
- Switch public domain to new service
- Remove old service
Canary Deployment
Gradually roll out to users:- Deploy with minimum containers:
- Monitor metrics (errors, performance)
- Increase
minContainersif stable - Scale to full capacity
Rollback
If a deployment fails or causes issues:Via GUI
- Go to service detail
- Click Deployments history
- Select previous successful deployment
- Click Redeploy
Troubleshooting Deployments
Build Fails
Dependency installation fails
Dependency installation fails
Check your package manager:Ensure
package-lock.json is committed.Build command errors
Build command errors
Test locally first:Check build logs for specific errors.
Out of memory
Out of memory
Increase build resources or optimize build:
Readiness Check Fails
Health endpoint not responding
Health endpoint not responding
Ensure your app listens on the correct port:
Database connection fails
Database connection fails
Check database service is running and accessible:
Best Practices
Use Health Checks
Always implement readiness checks to prevent routing traffic to broken deployments.
Test Locally First
Run build commands locally before deploying to catch issues early.
Monitor Logs
Watch deployment logs in real-time to catch issues immediately.
Keep Dependencies Updated
Regular updates prevent security issues and deployment failures.
Next Steps
Configure Scaling
Set up auto-scaling for your application.
Build Pipeline
Advanced build configuration options.