This repository contains a basic setup for Traefik as a reverse proxy with dynamic service discovery using Docker and a custom services.yaml
file.
- Docker installed on your system
- Docker Compose installed on your system
-
Clone this repository:
git clone https://github.com/zShamu/quick-traefik-loadbalancer.git cd quick-traefik-loadbalancer
-
Create a
services.yaml
file using the provided Bash script:sudo ./deploy.sh
Follow the prompts to enter the URLs / IP addresses.
-
Access the Traefik dashboard:
Open http://localhost:8080/ in your web browser. You can monitor the configured services and routing rules from the Traefik dashboard.
-
Test the dynamic service discovery:
- Create and deploy Docker containers with the desired URLs.
- Traefik will automatically discover and route traffic to these containers based on the rules defined in the
services.yaml
file.
-
Stop Traefik and clean up:
docker compose down traefik
- Adjust the Traefik configuration in the
docker-compose.yaml
file as needed. - Modify the
deploy.sh
script or manually edit theservices.yaml
file to customize entryPoints, URLs and more.
This project is licensed under the MIT License - see the license file for details.