Skip to content
Alan David Garcia edited this page Sep 10, 2015 · 12 revisions

coming soon

npm run deploy dev

#production setup for ubunutu

On your Server

  1. install compliers on ubuntu: https://help.ubuntu.com/community/InstallingCompilers
  2. install mongodb - http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ install node https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
  • install nodejs-legacy on ubuntu sudo apt-get install nodejs-legacy
  • install npm on ubuntu sudo apt-get install npm
  1. install node - https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
  2. install pm2
  • $ npm install pm2 -g --unsafe-perm
  • $ pm2 startup ubuntu # start as a service
  1. install forever and nodemon
  • $ npm install forever -g
  • $ npm install nodemon -g
  1. install nginx
  • $ sudo apt-get install nginx
  1. copy ssh keys to server if using ssh, or set up keys for deployments *$ ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
  2. on server, install git, make sure your server has access to git repo
  1. create directory for app on server
  • $ cd /var/www && mkdir mywebapp

On your local machine

  1. set up environment config
  • set up the deployment environments mywebapp/periodicjs/content/config/deployment/ecosystem.json
  • If you are not using the install extension, you need to set up your config files manually: $ mywebapp/periodicjs/content/config/(config.json|environment/[environment].json)
  • you can specify relative path to public key from mywebapp/periodicjs directory
  • commit your changes to github
  1. set up run pm2 deployment
  • from periodicjs directory $ npm run deploysetup [name of deployment environment]

On your server

  1. test your periodic app
  • $ cd path/to/webapp/current/periodicjs && npm install --production
  • create log directory $ mkdir logs
  • $ npm start [name of environment]
  • once its working, stop your servernpm stop
  • run your application forever $ npm run forever [name of environment]
  1. push changes to github
  2. start on prod
$ npm run deploy_prod

on server

$ cd [/path/to/webapp]/current/periodicjs
$ npm run start_prod
  1. nginx conf: update your nginx conf to proxy nginx, sample config in content/config/deployment/periodic.nginx.conf

  2. restart nginx

$ service nginx restart