Quick Start: Traefik Dashboard with Custom Domain
Quick Start: Traefik
Preparation
Create the necessary directories and files:
1 | mkdir -p traefik/dynamic-conf && cd traefik && touch compose.yml traefik.yml dynamic-conf/self.yml |
Configuration Files
compose.yml
1 | services: |
Note: Mounting the Docker socket (
/var/run/docker.sock
) can pose security risks. Consider using more secure alternatives in production environments.
traefik.yml
1 | ### Static Configuration |
Security Warning:
insecure: true
is not recommended for production environments. Consider setting up proper authentication for the API and dashboard.
self.yml in dir dynamic-conf
1 | ### Dynamic Configuration |
DNS Configuration
Configure your DNS or modify your hosts file:
- For Unix-like systems: Edit
/etc/hosts
- For Windows: Edit
C:\Windows\System32\drivers\etc\hosts
Add the following line:
1 | 127.0.0.1 traefik.x.internal |
Run
1 | docker compose up -d |
Access: http://traefik.x.internal