Pre VM Tasks
- Create Auth0 Applications. Create the 2 Tenants(development and production).
- Create database with proper IP whitelisting as mentioned here
There are a few packages/things to install.
This will require node js to be installed. PM2 is a node js package that runs the node server in the background
src/dashboard/ecosystem.config.js Log files will be created at
month-day-year_hour.minutes.seconds. Please make sure to create the folder
../../../../pm2Logs/. PM2 will do the rest.
Found here. Basically run the commands
And then set up the config in
/home/YOUR_USER_NAME/.config/code-server. Mine looks like
Make sure the port is setup in the firewall
This is a reverse proxy that runs on ports 80 and 443 and redirects traffic to the node server so that it doesnt have to run in sudo mode.
Check to see its running with
- Setup NGINX here and Certbot here
- Go to
Coastal-Image-Labeler/src/dashboardand install dependencies with
- Create the
.env.*.localfiles like here, get their values like here.
- Run the server with
npm run pm2which will build and start the site in production mode. If need to run the site in development mode, run
npm run dev.
As a note,
sudo pm2 list will show all pm2 processes. To stop/delete the server type
so that next time theres a clean restart.
Restarting Server With New Changes
git pull you can simply run
which will end the current pm2 process (stops and deletes) and then builds and starts the site/server.