This project demonstrates the setup of a containerized infrastructure using Docker. The infrastructure includes a load balancer, web services, and a database, all orchestrated using Docker Compose.
- Project Overview
- Prerequisites
- Getting Started
- Project Structure
- Usage
- Maintenance
- Contributing
- License
Refer to the technical documentation for detailed information on configuring the Docker project.
This project sets up a Docker-based infrastructure with the following components:
- Load Balancer: Utilizes HaProxy to distribute incoming traffic between two web services.
- Web Services (web1 and web2): Hosts application content and serves it over HTTP.
- Database (db): MySQL database service for data storage.
Before you begin, ensure you have the following:
- Docker installed on your system.
- A code editor for making modifications.
- Clone this repository to your local machine.
- Navigate to the project directory.
The project directory structure is organized as follows:
web1/
: Dockerfile and application files for the first web service.web2/
: Dockerfile and application files for the second web service.haproxy.cfg
: HaProxy configuration file.docker-compose.yml
: Docker Compose configuration file.certs/
: Directory for SSL/TLS certificates (not included in the repository).
- Update the
Dockerfile
in theweb1/
andweb2/
directories with your application's requirements. - Configure your SSL/TLS certificate and place it in the
certs/
directory. - Modify the
docker-compose.yml
file to match your environment and requirements. - Open a terminal and navigate to the project directory.
- Run the following command to start the services:
docker-compose up
- Access the services through the appropriate URLs.
- To update the infrastructure after changes in the Dockerfiles or configuration, use:
docker-compose down
docker-compose build
docker-compose up -d
Contributions are welcome! If you find issues or have suggestions, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.