Last active
March 27, 2021 17:05
-
-
Save Ameen-Alam/ae7c78b3f69a6d13b64b33f204578e20 to your computer and use it in GitHub Desktop.
Node-Production-Pm2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/57627934/passing-environment-variable-to-pm2-is-not-working