Skip to content

Update Dockerfile to Use Node.js 20 and Simplify Image Setup #217

@Oxyrobit

Description

@Oxyrobit

The current Dockerfile uses Node.js 16 and includes manual user/group modifications (usermod, groupmod, etc.). This setup can be simplified and modernized by upgrading to Node.js 20 and relying on the official node user already provided in the base image.

Proposed Changes:

  • Upgrade from node:16.13-alpine3.13 to node:20-alpine.
  • Remove manual UID/GID adjustments using shadow, usermod, etc.
  • Use the built-in node user directly.
  • Simplify the build and runtime steps.
  • Use --omit=optional and --omit=dev to optimize npm ci installs.
  • Improve Dockerfile readability and maintainability.

Benefits:

  • Smaller, more secure image.
  • Updated to a maintained Node.js version (v20 LTS).
  • Fewer layers and dependencies to manage.
  • Easier to maintain and understand.

Affected File:

  • Dockerfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions