Enable Serverless
Currently, Zeabur supports Serverless deployment for these languages/frameworks:
Try it in your own Zeabur service
Add ZBPACK_SERVERLESS=1
in the “Environment Variables” column and click “Redeploy.”
Your service will be deployed as a serverless service.
Declare as a serverless service
In the root directory of your service’s source code, create a zbpack.json
file
(or modify it if it already exists) and add the following content:
{
"serverless": true
}
This will declare that your service can be deployed in a serverless form, and Zeabur will automatically deploy it in serverless mode.
Revert to containerized mode
If you are certain that your service does not support serverless mode (for example, if it has important
background tasks), it is recommended to change the serverless
field in zbpack.json
to false
.
Unless you manually set ZBPACK_SERVERLESS
in the future, Zeabur will not deploy your service in
serverless mode.
If you just want to test if the traditional container mode works properly, add FORCE_CONTAINERIZED=1
to the environment variables and redeploy to switch back to the traditional container mode.
This variable is enabled for old services by default.