This is the recommended method to run the server in the cloud. For example, you might use this method if you're running it in production.
-
Sign up for a Grafana Cloud account if you'd like to observe the system using Grafana Cloud.
-
Edit Grafana Agent's configuration if required.
-
Set up PostgreSQL 14.4. For example, GCP SQL, AWS RDS. It's recommended to allocate 0.25 vCPU, 0.5 GB of memory, and 5 GB of storage.
-
Set up RabbitMQ 3.11, and install the RabbitMQ Delayed Message Plugin. For example, Stackhero for RabbitMQ. It's recommended to allocate 0.25 vCPU, 2.5 GB of memory, and 1 GB of storage.
-
Set up the server:
-
Clone the repo using one of the following methods:
-
SSH:
git clone git@github.com:neelkamath/node-js-template.git
-
HTTPS:
git clone https://github.com/neelkamath/node-js-template.git
-
-
Change the directory:
cd node-js-template
-
Build the Docker image:
docker build -f docker/node-js-template/Dockerfile .
-
Run the Docker image on port 3,000 (this can be overridden using the
PORT
environment variable). For example, GCP Run, AWS Fargate. It's recommended to allocate 2 vCPU, and 4 GiB of memory. Any number of instances can be run. -
Set the environment variables.
-
Connect to PostgreSQL and RabbitMQ.
-