Miget Buildpacks automatically detect and build your Node.js applications when you select Auto detection (Miget Buildpacks) as the build method. No configuration is required for most projects. For the full reference, visit the migetpacks Node.js documentation.

Detection

Your application is detected as Node.js when one of these files is present in the root directory:
  • package.json
  • package-lock.json
  • yarn.lock
  • pnpm-lock.yaml

Version Detection

The Node.js version is determined from the following sources, in order of priority:
  1. .nvmrc
  2. .node-version
  3. engines.node field in package.json
If no version is specified, the latest LTS version is used.

Build Process

During the build, the following steps are performed:
  1. Package manager detection - The package manager is auto-detected from your lockfile:
    • package-lock.json → npm
    • yarn.lock → yarn
    • pnpm-lock.yaml → pnpm
  2. Dependency installation - All dependencies are installed using the detected package manager.
  3. Build script - If a build script is defined in your package.json, it runs automatically.
  4. Pruning - After the build, devDependencies are removed to keep the production image lean.
  5. Caching - The node_modules directory is cached between builds using layer caching, which speeds up subsequent deployments.

Run Command

The run command is resolved in the following order:
  1. web process in a Procfile
  2. start script in package.json
  3. server.js or index.js (if present)
You can also override the run command directly in the Miget dashboard when creating your app or changing the deployment source.
Builder settings showing Run Command override

Configuration

You can customize the build and runtime behavior through the Miget dashboard and repository configuration files:
  • Environment variables - Set under Settings -> Variables in the Miget dashboard
  • Procfile - Define the start command at the root of your repository
  • app.json - Application manifest for additional configuration
  • Project Path - For monorepo setups, specify the subdirectory containing your application code in the Advanced tab
  • Pre-Deploy Command - Run a command before deployment (e.g., database migrations) in the Advanced tab
  • Post-Deploy Command - Run a command after successful deployment (e.g., seeding data, cache warming) in the Advanced tab

Docker Hardened Images

You can enable Docker Hardened Images (DHI) in the Advanced tab when creating your app or changing the deployment source. When enabled, your application is built using distroless runtime images with a minimal attack surface, no shell, and no package manager.
Advanced builder settings with Docker Hardened Images toggle
For the complete reference, see the migetpacks Node.js documentation.