Skip to content

Latest commit

 

History

History
97 lines (69 loc) · 1.9 KB

DEPLOY.md

File metadata and controls

97 lines (69 loc) · 1.9 KB

DEPLOY

LOCAL

  1. Ensure latest Ubuntu updates
$ sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get update && sudo apt-get upgrade -y
  1. Install curl, make, g++, libkrb5-dev and git
$ sudo apt-get install curl make g++ libkrb5-dev git -y
  1. Install node version manager
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
  1. Install latest available Node.js
$ nvm install node
  1. Install PM2
$ npm install pm2 -g
  1. Install redis-server
$ sudo add-apt-repository ppa:chris-lea/redis-server
$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install redis-server -y
  1. Install MongoDB for your Ubuntu version.
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install -y mongodb-org
  1. Enable MongoDB to automatically startup when systems boots up
$ sudo shutdown -r now
$ sudo systemctl daemon-reload
$ sudo systemctl start mongod
$ sudo systemctl enable mongod
  1. Deploy ewea into your server
$ git clone https://github.com/CodeTanzania/ewea.git
$ cd ewea
$ npm install
  1. Copy and ensure correct environment variables
$ cp .env.example .env
  1. Setup ewea into your server
$ npm run process:start
$ npm run process:save
$ npm run process:startup

You will receive directions to finalize setup by copy/paste given commands.
  1. Whenever source codes updated make sure you update running processes by:
$ npm run process:reload
$ npm run process:restart
  1. Verify everything is working
$ sudo shutdown -r now (optional)
$ curl http://0.0.0.0:5000