Skip to content

Feature request: official Docker image that honors .node-version #1490

@wladpaiva

Description

@wladpaiva

Feature request

Please consider publishing an official Vite+ Docker image that can keep the container's Node.js version aligned with the project's pinned Node version.

Problem

When building a Vite+ project into a Docker image, I need the runtime Node.js version to match the project's .node-version file.

In this project, .node-version contains 24.15.0, and vp --version correctly reports:

Environment:
  Package manager  pnpm v10.33.2
  Node.js          v24.15.0 (.node-version)

While optimizing the image, I can use plain alpine:3.23 with apk add nodejs to get a much smaller runtime image. However, Alpine currently installs Node v24.14.1, which does not match the project requirement. The safer workaround is to use an official Node image such as node:24-alpine, but that roughly doubles the image size in this case.

Desired behavior

It would be helpful if Vite+ provided an official Docker image or documented Docker image pattern that honors the project's .node-version file.

For example, a Vite+ image could either:

  • read .node-version and install/use that exact Node version during the build/runtime flow, or
  • provide image tags that map to exact Node versions managed by Vite+, or
  • document the recommended Docker pattern for keeping container Node versions aligned with .node-version.

Why this matters

Without an official Vite+ Docker image or recommended pattern, projects that need an exact Node version have to choose between:

  • a larger official Node base image that matches the version more closely, or
  • a smaller distro package such as Alpine's nodejs, which may lag behind the project's .node-version patch version.

Workaround

Use an official Node image such as node:24-alpine when exact patch-version alignment matters, or accept the distro-packaged Node version when image size matters more.

Validations

  • I searched existing issues for Docker/image/node-version related reports.
  • I checked the closest existing Node version management issue (Node version management #1200), which appears to be about slow Node installation/runtime management rather than Docker image version alignment.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions