What will you learn in this guide?
- ✓ How to customize your project's compilation behavior in your CI/CD pipeline
- ✓ How to start your application by defining custom run commands
- ✓ Configuring scenarios like Next.js custom build command and Node.js production run script
Skyversal analyzes your project's source code to automatically configure the best build and run commands suited to its language. However, if you have a Laravel Octane deploy process or use a non-standard startup script, you can override the automatic detection and define your own custom commands.
🛠️ 1. Editing Custom Commands
Follow these steps sequentially to define custom build and run commands for your project:
🏗️ 2. What is a Build Command?
The build command is the compilation and preparation stage executed in an isolated container before your project is exposed to internet traffic. It is used to minify CSS/JS files, optimize source codes, or compile TypeScript files.
npm / pnpmnpm run build or pnpm run buildnpmnpm run buildnpmnpm run buildcomposer & npmcomposer install --no-dev --prefer-dist --optimize-autoloader && npm install && npm run buildAngular CLI / npmnpm run build
You can execute multiple commands sequentially using the && operator. If the first command completes successfully, the next one automatically starts.
npm install --frozen-lockfile && npm run build
🚀 3. Run Command: Starting Long-running Processes
The run command is the main command that boots up your application after the build process finishes successfully, and it keeps running. As long as this command is active, your application provides uninterrupted service over our global network.
npm / Bunnpm start or bun run startGunicorngunicorn app:app or gunicorn core.wsgiOctane / Nginxphp artisan octane:start or Nginx + PHP-FPMCompiled Binary./main or ./release/serverCrucial Warning: Port Binding
When your Run command executes, ensure it broadcasts over the 0.0.0.0 IP and uses the port Skyversal expects. Developers often bind to localhost or 127.0.0.1 and encounter "App not accessible" errors. The exact port your app needs to bind to is automatically passed by the system as the $PORT environment variable.
❓ 4. Common Problems and Solutions
❌ "Command not found" or "Script Missing" Error
Make sure the command you are using is defined under the `scripts` object in your project's `package.json` file. If you use pnpm or yarn, verify that your lock files are present in the repository.
❌ My application constantly falls into "Crashed" state
The command you entered in the Run field must start a long-running web server or process. One-off scripts are a common cause of this error. For example:
php artisan migrate
The job finishes. The container closes and the system assumes the application crashed.
npm start
Or gunicorn app:app. Runs continuously, listens for requests.
Remember: Re-deploy After Changes!
Simply clicking "Save" on your Build and Run commands does not instantly apply them. For the new commands to take effect in the live environment, you must navigate to the Deployments tab and click the Re-deploy button.
🎉 Everything is Ready!
You have fully customized your build and run behaviors. Your application will now compile and deploy entirely according to your rules.
In the next guide, you can learn how to monitor the outputs generated by your application in real-time while it is running in the background.
👉 Live Deploy Logs