Skip to main content

Docker Image

Add Docker packaging to an existing workspace without changing what the application does.

Why Use This Command?

  1. Keeps Docker separate from framework scaffolds so one Express or Discord template can work with or without containers.
  2. Requires an explicit workload profile instead of guessing from dependencies or filenames.
  3. Adds a pinned, non-root Dockerfile, a matching Compose service, .dockerignore, and the canonical deploy:container script.
  4. Uses the same packaging profiles as Nova's Astro, Discord bot, Docker image, Express.js, Next.js, Vite, and Docusaurus scaffolds.

Requirements

  • Node.js runtime — Use any Node.js LTS release.
  • Project root — Run from the directory containing the top-level package.json.
  • Existing workspace — Select a child workspace with a readable package.json.
  • Docker — Install Docker with Compose support before running the generated deployment script.

Usage

Options

FlagDescription
-d, --dry-runValidate the target and planned profile without writing files.
--profile <profile>Select one of the six reviewed profiles listed below.
-r, --replace-fileOverwrite changed files instead of creating .nova-backup copies.
--workspace <path>Select a child workspace relative to the current Nova project root.

Profiles

ProfileIntended WorkloadRuntime Contract
http-serviceExpress and other Node.js HTTP services.Node.js runtime on port 3000 with an HTTP health check.
background-serviceDiscord bots and other Node.js workers.Node.js runtime without a port or network health check.
container-nativeAppliances such as VPN or proxy images.Minimal Alpine base without a framework, port, or default command.
static-siteAstro, Docusaurus, or other build directories.Multi-stage build served by unprivileged NGINX on port 8080.
astro-nodeAstro standalone Node.js server output.Node.js runtime on port 4321 with an HTTP health check.
nextjs-standaloneNext.js standalone output using distDir: build.Node.js runtime on port 3000 with an HTTP health check.

The public generator's static-site profile reads the conventional build directory. Nova's Vite scaffold uses the same profile internally with Vite's dist directory. For an existing Vite app, prefer the scaffold's --docker-image option when creating it, or adjust the generated Dockerfile's copied directory after reviewing the app's build output.

Output Files

FileDescription
.dockerignoreExcludes local dependencies, builds, secrets, and Git metadata.
DockerfileProfile-specific pinned image and non-root runtime.
compose.ymlProfile-specific local and deployment service definition.
package.jsonAdds the canonical deploy dispatcher and deploy:container command.

The generator owns Docker packaging only. It does not add Express, Discord, VPN, proxy, or application source code. Existing custom deploy:* steps remain beside deploy:container.