liveBook · Manning

Production

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A production environment is a deployment environment that hosts an application for access by real customers or users.

A production environment hosts an application where real customers can access and use it. Moving from local development to production means deploying the application to customer-facing infrastructure, such as a cloud Kubernetes cluster. section 2.6.7 section 6.3

A practical production path includes:

  • Install only runtime dependencies with npm install --omit=dev, excluding packages needed solely for development. section 2.6.7
  • Start the Node.js service through the conventional npm start script, which hides the application’s specific entry file. section 2.6.7
  • Package and publish the service with Docker, then deploy it to a Kubernetes cluster. section 6.11.9 section 12.9
  • Automate testing and deployment so code changes can reach production after validation. section 8.9.12

Separating production environments

Terraform can create distinct development, test, and production instances by receiving an environment value and deriving names such as flixtube-production. Blue-green deployment extends this approach by routing customers to one production environment while developers prepare and test another, then switching DNS when it is ready. section 12.2.5 section 12.4.5

Listing 2.6 Adding a start script to package.json
{
  "name": "example-1",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "scripts": {
    "start": "node src/index.js"   #1
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^5.0.0-beta.1"
  }
}

Inspect a complete package.json start script showing how a Node.js service is made runnable through npm start. section 2.6.7

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains dependency selection, startup conventions, deployment, environment separation, automation, and blue-green switching; it stops short of detailed infrastructure implementation.
Examples
Uses Node.js installation commands, npm start, Kubernetes clusters, Terraform variables, and blue-green DNS switching.
What it assumes
Assumes a working microservice and development workflow while teaching the transition from local execution to customer-facing deployment.
What you can do after
Operate/configure production by selecting runtime dependencies, starting a Node.js service, deploying to Kubernetes, and switching environments safely.
How it connects
Connects development environment, integration environment, test environment, Kubernetes, Docker, Terraform, continuous deployment, and DNS.

Also explained in

Compare how 8 books explain production →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.