Skip to content

Instantly share code, notes, and snippets.

@Ameen-Alam
Last active March 27, 2021 17:05
Show Gist options
  • Save Ameen-Alam/ae7c78b3f69a6d13b64b33f204578e20 to your computer and use it in GitHub Desktop.
Save Ameen-Alam/ae7c78b3f69a6d13b64b33f204578e20 to your computer and use it in GitHub Desktop.
Node-Production-Pm2
#!/bin/bash
cd ~
sudo su
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
bash nodesource_setup.sh
apt-get install -y nodejs git build-essential
echo NodeJs Version
node -v
echo NPM Version
npm -v
echo Git Clone
git clone https://github.com/Ameen-Alam/NodeJS-File-Upload-AWS-S3-Bucket.git
cd NodeJS-File-Upload-AWS-S3-Bucket
npm install
export PORT=3000
export AWS_BUCKET_NAME="myawsbucketnodeapp"
export NODE_ENV="production"
npm install -g pm2
pm2 start ecosystem.config.js
echo Node Run