EC2 Deployment
Dependency
-
nginx:
sudo apt install nginx -y -
jdk-11
sudo apt install jdk-11 -y -
nodejs and npm
https://github.com/nodesource/distributions/blob/master/README.md
Shells
-
pull-from-githubpulls backend and admin ui code from github.
-
view-statuschecks the backend server running status.
-
run-backendwill replace the database url in backend code’s
application.properties, then detect and stop existing working process and start a new one.
Run all scripts in above order. Note that maybe need to change the database url in application.properties file.
Config nginx
A example config file is in the nginx.sites-available/default, can use this to replace the original one /etc/nginx/sites-available/default.
About backend admin page
cd NUS-tour-backend-adminUI
sudo npm install
sudo npm run build:prod
The example nginx config file will map /admin url to this ./dist folder.