This repository provides a single Docker Compose configuration for setting up a multi-service API load balancer using Nginx, HAProxy, and Flask services. The included services enable efficient load balancing and CORS support for seamless API communication.
Before getting started, ensure that you have the following software installed on your system:
- Docker
- Docker Compose
- Clone this repository to your local machine:
git clone repository-url
- Navigate to the repository directory:
cd <repository-directory>
- To launch the services, execute the following command:
docker-compose up
This command will start the Nginx, HAProxy, and three Flask API services. Nginx serves as the frontend, HAProxy handles load balancing, and Flask services simulate API endpoints.
- Nginx (Frontend): Access the website at http://localhost.
- HAProxy (Load Balancer): Access the load balancer at http://localhost:8080.
- Flask API Services: Access the API services at http://localhost:8001, http://localhost:8002, and http://localhost:8003.
You have the flexibility to customize the services and configurations by modifying the Docker Compose file and individual service configurations within this repository.
We welcome contributions to this project. Feel free to open issues or submit pull requests. Your contributions are valuable and greatly appreciated!
This project is distributed under the GNU General Public License (GPL-3.0). Refer to the LICENSE file for comprehensive details regarding the licensing terms.