Set a Start Command
A start command is the process used to run a Deployment's code, such as python main.py
or npm run start
.
CloudStation automatically configures the start command based on the code being deployed. See Build and Start Commands for more details.
Configure the Start Command
When necessary, start commands may be overridden for advanced use cases, such as deploying multiple projects from a single monorepo.
The behavior of the start command depends on the type of deployment:
Dockerfile / Image
-
The start command overrides the image's
ENTRYPOINT
in exec form. -
If environment variables are required in the start command, wrap the command in a shell:
/bin/sh -c "exec python main.py --port $PORT"
This is necessary because commands run in exec form do not support variable expansion.
Nixpacks
- The start command is executed in a shell process.
- Supports environment variables without requiring a shell wrapper.
Dockerfiles & Images
If your service deploys with a Dockerfile or an image, the start command defaults to the ENTRYPOINT
and/or CMD
defined in the Dockerfile.
Start Command Details
- Description: Command executed to start new deployments.
- Usage: Specify the command that should run after the application has been built and deployed.
- Examples:
- Node.js application:
npm start
- Python application:
python app.py
- Node.js application:
- Additional Information: Ensure all necessary services and configurations are in place for smooth execution.
Edit this file on GitHub