Node.js + PM2 + NGINX + Redis on CentOS 7 - Justin Silver

PHOTO EMBED

Wed Jan 24 2024 20:20:39 GMT+0000 (Coordinated Universal Time)

Saved by @djlsme

#!/bin/bash

# make sure the SRC_NODE_VERSION is set
if [[ -z $SRC_NODE_VERSION ]]; then
  echo "You must specify a node version using \$SRC_NODE_VERSION";
else
  # Select node version to install
  curl --silent --location https://rpm.nodesource.com/setup_$SRC_NODE_VERSION.x | bash -
  
  # install via yum
  yum install -y git gcc-c++ make nodejs
fi

# PM2 - install as global
npm install pm2@latest -g
content_copyCOPY

https://www.justinsilver.com/technology/node-js-pm2-nginx-redis-centos-7/