explaingit

nodejs/docker-node

8,558DockerfileAudience · ops devopsComplexity · 2/5Setup · easy

TLDR

The official source for Node.js Docker images on Docker Hub, providing full, slim, and Alpine variants so developers can containerize Node.js apps with a consistent, ready-to-use runtime base.

Mindmap

mindmap
  root((docker-node))
    Image variants
      Full Debian
      Slim Debian
      Alpine minimal
    Common patterns
      App base image
      Single file run
      Docker Compose
    Best practices
      Non-root user
      Signal handling
      Reduce image size
    Maintenance
      Node.js community
      Docker Hub published
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Use the official Node.js image as the base for your app Dockerfile to ensure consistent runtime across dev and production.

USE CASE 2

Use the Alpine variant to produce a much smaller final Docker image for faster deploys and a reduced attack surface.

USE CASE 3

Use Docker Compose with the official Node.js image to run your app alongside a database service.

USE CASE 4

Run a single JavaScript file directly with the Node.js image without writing a Dockerfile at all.

Tech stack

DockerfileNode.jsDockerAlpine LinuxDebian

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

This repository is the official source for the Node.js Docker images that are published to Docker Hub. Node.js is a runtime that lets you run JavaScript code outside of a browser, commonly used to build web servers and other networked applications. Docker is a system for packaging an application and all its dependencies into a container so it runs the same way on any computer. The images here give developers a ready-to-use base that already has Node.js installed. To use one, you reference the image in your own Dockerfile and build your application on top of it. The most common starting point is a line like FROM node:24, which pulls in the full Debian-based image with the specified version of Node.js. Several image variants are available to suit different needs. The standard image is large and includes many common system packages, making it easy to install additional tools. The alpine variant is based on a minimal Linux distribution and produces much smaller final images, which is useful when keeping container size small matters. The slim variant is a middle ground: Debian-based but with non-essential packages removed. The repository also provides guidance on common setup patterns. For example, it shows how to write a Dockerfile for a typical Node.js app, how to use Docker Compose to run your app alongside other services, and how to run a single JavaScript file directly using the image without writing a Dockerfile at all. Best practices documentation in the repository covers topics like avoiding running containers as the root user, reducing image size, and handling signals correctly so containers shut down cleanly. The images are maintained by the Node.js community working group.

Copy-paste prompts

Prompt 1
Write a production-ready Dockerfile for my Express.js app using node:24-alpine with a non-root user and proper signal handling.
Prompt 2
Create a docker-compose.yml that runs my Node.js app alongside a PostgreSQL database using the official node image.
Prompt 3
Compare node:24, node:24-slim, and node:24-alpine, when should I use each and what are the typical image size differences?
Prompt 4
Update my existing Dockerfile to follow the nodejs/docker-node best practices for running as a non-root user and handling shutdown signals correctly.
Open on GitHub → Explain another repo

← nodejs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.