Skip to content

node-container

Create Node.js Dockerfiles using Optum golden images and the standard multi-stage build pattern. Use when asked to author or update Dockerfiles for Node.js services that must comply with Optum golden image standards.

active
IDE:
claude
codex
vscode
Version:
1.0.0
Owner:pcorazao
docker
golden-image
containerization
podman

Node Container (Optum Golden Images)

Use this skill when the user wants a Dockerfile for a Node.js app that must follow Optum golden image standards.

Workflow

  1. Confirm the app entrypoint, port, build step (if any), and package manager/lockfile.
  2. Determine the current supported Node image tags before choosing a build and runtime base image.
  3. Start from the Optum golden images:
    • Default floating tags:
      • Build stage: edgeinternal1uhg.optum.com:443/glb-docker-uhg-loc/uhg-goldenimages/node:24-latest-dev
      • Runtime stage: edgeinternal1uhg.optum.com:443/glb-docker-uhg-loc/uhg-goldenimages/node:24-latest
    • When you need to pin to the current supported Node major, use the discovery steps below and prefer versioned tags such as node:24-latest-dev and node:24-latest.
  4. Use multi-stage build, install deps in builder, run build if needed, then prune dev deps.
  5. Set WORKDIR /app, copy app code, and set ENV NODE_ENV=production.
  6. Run as the default non-root user in the golden image (avoid USER root).
  7. Add EXPOSE and ENTRYPOINT/CMD based on the app’s server.
  8. Optional: add a healthcheck if the service exposes a simple HTTP endpoint.

Find Latest Node Image Version

Use the scripts in scripts/ to inspect the Golden Image Navigator API directly.

  1. Run scripts/01-node-product.sh to list supported Node versions.
  2. Choose the highest supported concrete version instead of relying on search=node.
  3. Use the matching concrete image scripts to verify the exact runtime and build tags:
    • scripts/02-node-image-24-latest.sh
    • scripts/03-node-image-24-latest-dev.sh
    • scripts/06-node-image-24-slim-latest.sh
    • scripts/08-node-image-22-latest.sh
    • scripts/09-node-image-22-latest-dev.sh
  4. Use the floating tag scripts only when you explicitly want the tracked aliases:
    • scripts/04-node-image-latest.sh
    • scripts/05-node-image-latest-dev.sh
  5. Run scripts/07-node-image-search.sh only for exploration. It is not precise enough for automation because it also returns other products whose names contain node.

Current API behavior discovered from these scripts:

  • /api/products/node returns supported versions 24, 22, and latest.
  • The highest supported concrete Node version is currently 24.
  • The concrete tags currently verified are 24-latest, 24-latest-dev, and 24-slim-latest.
  • The floating aliases latest and latest-dev are tracked tags, but they are separate API entries from 24-latest and 24-latest-dev.

Recommended selection flow:

  1. Query /api/products/node.
  2. Pick the highest supported non-latest version.
  3. Use <version>-latest for runtime and <version>-latest-dev for the build stage.
  4. Use <version>-slim-latest only when a slim runtime variant is appropriate.

Template

Use templates/Dockerfile.template as the starting point and adjust:

  • files copied into /app
  • port and entrypoint
  • build step (npm run build/yarn build/pnpm build)
  • dependency install command if not using npm

References

../../instructions/docker.instructions.md ../../instructions/optum-golden-containers.instructions.md

Related Assets