1.2 KiB
1.2 KiB
Deployment with pm2
- archive project and copy onto host system
cd ..
tar -czvf <archive name>.tar.gz --exclude={"postgres-gtfs-rest-api/.git","postgres-gtfs-rest-api/node_modules"} postgres-gtfs-rest-api/
scp -P <host ssh port> <archive name>.tar.gz <user>@<host>.<domain>:~
-
Setup Node.js and NPM on target system
-
copy service source into the working folder
sudo tar -xzf ~/<archive name>.tar.gz -C /opt/
- install dependencies
cd /opt/<archive name>
npm i
- set up service environment on host system
sudo vi /opt/<archive name>/.env
- define the following environment variables
DB_HOST=<host running database>
DB_PORT=<port of host running database>
DB_USER=<user granted permissions for database>
DB_PASSWORD=<user key>
DB_NAME=<database name>
NODE_ENV=<node environment mode>
PORT=<port offering this service>