-
Notifications
You must be signed in to change notification settings - Fork 50
4. Environment
ekedonald edited this page Jul 19, 2024
·
12 revisions
This document outlines the environment setup required to run the HNG Boilerplate Golang Web application in both development (test) and production environments. It covers the necessary software, hardware, and configuration settings, including setting up Nginx as a reverse proxy.
- Version: 1.19 or later
- Installation: Follow the official Go installation guide for your operating system.
- Version: 14 or later
-
Installation: You can install PostgreSQL using the package manager of your choice:
-
Homebrew (MacOS):
brew install postgresql
-
APT (Ubuntu):
sudo apt-get update sudo apt-get install postgresql postgresql-contrib
-
YUM (CentOS):
sudo yum install postgresql-server postgresql-contrib
-
Homebrew (MacOS):
- Purpose: To run PostgreSQL instances in containers, simplifying setup and teardown.
- Installation: Follow the official Docker installation guide.
- Version: Latest version recommended.
- Installation: Follow the official Git installation guide.
- Version: Latest stable version.
-
Installation: You can install Nginx using the package manager of your choice:
-
APT (Ubuntu):
sudo apt-get update sudo apt-get install nginx
-
YUM (CentOS):
sudo yum install nginx
-
APT (Ubuntu):
- Purpose: To manage and monitor the Go application processes.
-
Installation: Follow the official PM2 installation guide:
npm install pm2@latest -g
You need two PostgreSQL instances: one for regular development and one for running tests. You can set them up locally or use Docker for convenience.
To set up PostgreSQL instances using Docker, run the following commands:
docker run --name main_db -e POSTGRES_PASSWORD=password -d postgres
docker run --name test_db -e POSTGRES_PASSWORD=password -d postgres