ConceptsBuilds & runtimes
Node.js
What the generated Dockerfile does for a Node.js project, when you set no build or start command.
Base image. The image is node:<major>-alpine. A Bun project uses oven/bun:1-alpine.
1 / 4
The defaults
| Step | What Ferry does |
|---|---|
| Node.js version | It comes from engines.node in package.json. Ferry uses 22 when the range allows it. If not, Ferry uses the newest major version that the range allows. |
| Package manager | The package manager comes from the packageManager field or the lockfile: npm, Yarn, pnpm or Bun. Yarn and pnpm run through Corepack. |
| Install with npm | npm ci when there is a package-lock.json. If not, npm install. |
| Build | The build script of package.json, if there is one. |
| Start | npm start when there is a start script. With Yarn 2+: yarn start. With Bun: bun run start. |
Start with no start script | node with the main file, server.js, index.js or app.js. |
See the choice
==> Start command: npm start (the "start" script of package.json)- The install includes the dev dependencies. Thus your build tools are available.
- Ferry sets
NODE_ENV=productionafter the install. Thus it applies to the build and when the app runs.
A build command or a start command of the service replaces the default. See Start command.