ConceptsBuilds & runtimes
Start command
The start command starts your app in each container. Ferry finds it in three places, in order.
The service. The start command of the service (--start-cmd).
1 / 3
This order is for the images that Ferry generates.
Set the start command
ferry create mailer --type worker --repo https://github.com/you/app --start-cmd "node worker.js"Ferry runs the start command with /bin/sh -c. Thus $PORT and other variables expand.
The Procfile entry
| Service type | Entry of the Procfile |
|---|---|
| Web service, private service, static site | web: |
| Background worker | worker: |
| Cron job | cron:. If there is none, worker:. |
A cron job needs no start command: its command can come when it runs.
See the choice
The build log shows the start command and its origin.
==> Start command: npm start (the "start" script of package.json)If an instance stops immediately, read this line. A default such as the main file of a library does not always start a server. See The app exits right away.