Skip to main content

Overview

The docker schematic generates a production-ready Dockerfile and a .dockerignore at the specified directory. The Dockerfile is tailored to the package manager you use — selecting the correct base image, lockfile, and install command automatically.

Usage

Options

Generated files

Dockerfile behaviour by package manager

The Dockerfile follows a standard multi-step approach:
  1. Copy package.json and the lockfile.
  2. Install dependencies with frozen lockfile for reproducible builds.
  3. Copy the rest of the source.
  4. Run build.
  5. Start with start.

Examples

Generate a Dockerfile for an npm project:
Generate a Dockerfile for a pnpm project:
Generate in a specific directory: