Reference: leanengine.yaml
leanengine.yaml contains configurations for the server-side runtime environment. It uses YAML as syntax and should be placed in the root directory of the project.
Overriding Runtime Environment With runtime
You can override the environment that Cloud Engine automatically detects. You can use the following values:
cppdotnetgojavanodejsphppythonstatic(Frontend)
Overriding Command for Execution With run
run: $(npm bin)/serve -c static.json -l ${LEANCLOUD_APP_PORT}
You can use shell syntax here for purposes like accessing environment variables.
Overriding Command for Installing Dependencies With install
You can override the default command for installing dependencies (like npm install) or run additional commands before or after installing dependencies. You can specify multiple commands with an array, use shell syntax, and access environment variables.
Most runtimes have their default commands for installing dependencies. You can refer to the default command with use: default:
install:
- use: default
- npm run install-additional
When installing dependencies, only the dependency lists (like package.json) will be loaded into the build directory. To load additional files, use require:
install:
- require:
- frontend/package.json
- frontend/package-lock.json
- cd frontend && npm ci
Overriding Command for Building With build
build: NODE_ENV=production $(npm bin)/webpack
As with install, you can import the default command with use: default. You can specify multiple pieces of commands with an array. You can also use shell syntax and access environment variables.
When building your project, all the files in your project will be loaded into the build directory.
Specifying System Dependencies With systemDependencies
To install additional system dependencies during deployment:
systemDependencies:
- imagemagick
ffmpegA library for processing audio and videos.imagemagickA library for processing images.fonts-wqy文泉驿点阵宋体 and 文泉驿微米黑. Often used withchrome-headlessto display Chinese.fonts-notoSource Han Sans (comes with a large size). Often used withchrome-headlessto display Chinese.(discontinued).phantomjsA headless browser based on WebKitchrome-headlessHeadless Chrome. It comes with a large size and will significantly increase the time needed for deployment. It also consumes a lot of CPU and RAM resources. If you need to usepuppeteer, please provide{executablePath: '/usr/bin/google-chrome', args: ['--no-sandbox', '--disable-setuid-sandbox']}topuppeteer.launch.node-canvasThe system dependency required for installing node-canvas (you still need to installnode-canvasyourself).python-talibThe system dependency required for installing TA-Lib (you still need to installTA-Libyourself).
Adding system dependencies will significantly increase the time needed for deployment. Please avoid adding dependencies that your project doesn’t need.