harryworld / mean-learning-notes

Notes for learning MEAN Stack from Scratch
MIT License
2 stars 0 forks source link

Deploy workflow #7

Open harryworld opened 9 years ago

harryworld commented 9 years ago

MEAN stack deploy workflow

harryworld commented 9 years ago

Install EC2 for Node.js

Resolve Locale

locale-gen en_US.UTF-8

Ref: https://www.thomas-krenn.com/en/wiki/Perl_warning_Setting_locale_failed_in_Debian

Install NVM

sudo apt-get update
sudo apt-get install build-essential libssl-dev
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh
source ~/.bashrc

Install Node.js

nvm ls-remote
nvm install 0.12.0
nvm alias default 0.12.0
nvm use default

Install MongoDB

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

Install Nginx

sudo apt-get install nginx

Install Git

sudo apt-get install git

Streamline the build process

npm install gulp -g
npm install gulp --save-dev

Deployment

# install the cli tool
npm install -g flightplan

# use it in your project
npm install flightplan --save-dev

fly production

Keep system running

npm install pm2 -g
pm2 start ./bin/www -n mailgun

pm2 list

pm2 startup ubuntu