Share feedback
Answers are generated based on the documentation.

Node.js language-specific guide

This guide explains how to containerize Node.js applications using Docker.
Time to complete 20 minutes

Node.js is a JavaScript runtime for building server-side applications. This guide shows you how to containerize a TypeScript Node.js application using Docker, starting from a simple Express API and progressively adding features like a database and CI/CD.

This guide focuses on a backend Node.js API. If you're building a standalone frontend application, Docker has dedicated guides for React.js, Vue.js, Angular, and Next.js.

Acknowledgment

Docker thanks Kristiyan Velkov for his contribution to this guide.

What will you learn?

In this guide, you'll learn how to:

  • Containerize and run a Node.js application using Docker.
  • Set up a local development environment using containers.
  • Run tests inside a Docker container.
  • Configure GitHub Actions for CI/CD with Docker.
  • Inspect and generate supply chain attestations for your image.
  • Deploy your containerized Node.js application to Kubernetes.

Start by containerizing a Node.js application.

Prerequisites

  • Basic understanding of JavaScript and TypeScript.
  • Basic knowledge of Node.js and npm.
  • Familiarity with Docker concepts such as images, containers, and Dockerfiles. If you're new to Docker, start with the Docker basics guide.

Modules

  1. Containerize your app

    Learn how to containerize a Node.js application with Docker.

  2. Develop your app

    Learn how to develop your Node.js application locally using containers.

  3. Run your tests

    Learn how to run your Node.js tests in a container.

  4. GitHub Actions CI

    Learn how to configure CI/CD using GitHub Actions for your Node.js application.

  5. Secure your supply chain

    Learn how to inspect, generate, and verify supply chain attestations for your Node.js container image.

  6. Deploy your app

    Learn how to deploy your containerized Node.js application to Kubernetes.