Loadbalance between two App with HAproxy And Nginx (Gitlab CI-CD)
Pay attention to the image below
To run this project, you will need to add the following environment variables to your Gitlab Project Environment :
NEXUS_USER
--> "admin"
NEXUS_PASSWD
--> "admin"
NEXUS_REGISTRY
--> "YOUR_Nexus_Server_Host:5000"
Before running the project, we need to install Docker and Docker Compose
Download the convenience script for the latest release of Docker CE on Linux from get.docker.com
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
After this script finishes running, I always run a test docker command just to see if it’s working or not.
docker --version
The last step:
sudo usermod -aG docker $USER
sudo systemctl enable docker
First, confirm the latest version available in their releases page. At the time of this writing, the most current stable version is 2.10.2
.
Use the following command to download:
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
Next, set the correct permissions so that the docker compose command is executable:
chmod +x ~/.docker/cli-plugins/docker-compose
To verify that the installation was successful, you can run:
docker compose version
Clone the project
git clone https://github.com/SoroushImanian/Long-way.git
Go to the project directory
cd Long-way
Run Project :
docker-compose -f docker-compose-manual.yaml up -d