logo
0
0
Login

Node.js + Express + Docker

badge badge badge

In this example, you will use Cloud Native Build (CNB) to package a Node.js Express application, build a Docker image and push it to the Docker artifact repository.

Prerequisites

  1. Use Cloud Native Build (CNB) to build your project
  2. Environment variables and usage: Environment Variables
  3. Declarative build cache
  4. Plugins and usage: Plugin Market
  5. Learn how to use Docker Artifact Repository

Quick Start

Click the Fork button in the upper right corner to fork the project to your own repository. Then click the Cloud Native Development button to start remote development.

  1. Install dependencies
npm install
  1. Start development server (command line)
npm run dev

Alternatively, you can debug in VSCode:

  • Click the "Run and Debug" icon in the activity bar on the left side of VSCode
  • Select "Debug express-docker application" from the run and debug drop-down list
  • Click the green run button (or press F5 directly)
  • View configuration
  1. Access API
curl http://localhost:3000

About

node express 构建镜像并发布到 CNB Docker 仓库

Language
Markdown45.6%
Dockerfile26.9%
JavaScript6.9%
gitignore0.6%
Others20%