Web node:22-alpine

node-app

Node.js application with persistent code directory

Install

cardinal blueprint install node-app
cardinal blueprint install node-app
# or override resources / env at install time:
cardinal blueprint install node-app --memory 1g --cpus 2 -e KEY=value -y

Manual equivalent

cardinal run
cardinal run -d \
  --restart unless-stopped \
  -n node-app \
  -p "3000:3000/tcp" \
  -v "node_app:/app" \
  --memory 512m \
  --cpus 1.0 \
  -e NODE_ENV="production" \
  -e PORT="3000" \
  node:22-alpine \
  node /app/index.js

Configuration

Imagenode:22-alpine
Restartunless-stopped
Ports3000:3000/tcp
Volumesnode_app:/app
Memory512m
CPUs1.0
Commandnode /app/index.js
Environment variableDefault value
NODE_ENV production
PORT 3000

More web

Related stacks

node-postgres-app

Node.js + PostgreSQL 16 — Web app plus database with healthcheck.

nginx-node-reverse-proxy

Node.js + Nginx — App behind a reverse proxy.

node-postgres-compose

Node.js + PostgreSQL 16 — Compose-compatible YAML variant of the Node + Postgres stack.