This project demonstrates how to quickly get started with Traefik v3.x, including dynamic service integration and certificate configuration.
If you find this example helpful, please give it a star ✨. If you want to receive updates about this project, you can click watch 👀 and choose your preferred notification mode.
- ✅ Dynamic Service Integration: Automatic service discovery and configuration based on Docker labels
- ✅ Multiple Certificate Configurations: Support for both ACME automatic certificate issuance and local certificates
- ✅ HTTP/3 Support: Enable HTTP/3 (QUIC) protocol support
- ✅ Dashboard Interface: Built-in Traefik Dashboard visualization interface
- ✅ HTTPS Redirect: Automatically redirect HTTP requests to HTTPS
- ✅ GZIP Compression: Automatically enable response content compression
- ✅ Health Checks: Built-in health check mechanism
- ✅ Production Ready: Anonymous data collection and version checking disabled, suitable for production environments
traefik-v3-example/
├── scripts/ # Utility scripts directory
│ └── prepare-network.sh # Docker network creation script
├── traefik/ # Traefik service configurations
│ ├── base/ # Base configuration (requires environment variables)
│ ├── acme/ # ACME automatic certificate configuration
│ └── local-certs/ # Local certificate configuration
├── traefik-make-local-certs/ # Certificate generation tool
├── traefik-app-examples/ # Application integration examples
│ ├── flare/ # Flare service integration example
│ ├── stargate/ # Stargate Forward Auth service example
│ └── owlmail/ # OwlMail email testing service example
├── README.md # This document (English)
└── README.zh.md # This document (Chinese)
- Docker 20.10+
- Docker Compose 2.0+
- Basic Linux/Unix command line knowledge
Traefik requires a dedicated Docker network:
./scripts/prepare-network.shOr create it manually:
docker network create traefikChoose different configuration methods based on your needs:
-
Generate Self-Signed Certificates:
-
Start Traefik:
-
Configure ACME:
- Refer to ACME Configuration Documentation
-
Start Traefik:
- Refer to ACME Configuration Documentation
- Refer to Base Configuration Documentation
After successful startup, access the Traefik Dashboard:
- HTTPS:
https://traefik.example.com/dashboard/ - API:
https://traefik.example.com/api/
Note: Please replace
traefik.example.comwith your actual configured domain name and ensure DNS resolution is correct.
- Base Configuration: Requires complete environment variable configuration, supports both ACME and local certificates
- ACME Certificate Configuration: Uses Let's Encrypt automatic certificate issuance (requires DNS API Token)
- Local Certificate Configuration: Uses local self-signed certificates, suitable for testing environments
- Certificate Generation Tool: Uses certs-maker container to generate self-signed certificates
- Flare Service Example: Complete example of Flare service integration with Traefik
- Stargate Forward Auth Example: Stargate authentication service integration example, includes protected service demonstration
- OwlMail Email Testing Service Example: OwlMail email testing service integration example, supports SMTP and Web interface
- Traefik - Cloud-native reverse proxy and load balancer
- certs-maker - Certificate generation tool
- docker-flare - Flare service Docker image
- Stargate - Lightweight Forward Auth authentication service
- OwlMail - Email development and testing tool, compatible with MailDev
See the LICENSE file for details.
