Hey ,
I just started using traefik everything seams to work but I got issues with the Dashboard which loads forever. It also comes with huge CPU spikes and when it loaded successfully everytime it tries to refresh the data of the Dashboard the spikes continue. I sadly have no clue what this could cause. My first guess would be a wrong config but I'm not sure if that's the case.
docker-compose:
version: "3.9"
services:
traefik:
# Use the latest v2.6.x Traefik image available
image: traefik:v2.6
container_name: traefik
ports:
- "80:80"
- "443:443"
restart: always
env_file: .env
labels:
# Enable Traefik for this service, to make it available in the public network
- traefik.enable=true
# Use the traefik-public network (declared below)
- traefik.docker.network=traefik-public
# Define the port inside of the Docker service to use
- traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080
volumes:
# Map the dynamic conf into the container
- ./traefik/config.yml:/etc/traefik/config.yml:ro
# Map the static conf into the container
- ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro
# Mount the volume to store the certificates
- traefik-public-certificates:/etc/traefik/certs
# Add Docker as a mounted volume, so that Traefik can read the labels of other services
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/log/traefik:/var/log/traefik
networks:
# Use the public network created to be shared between Traefik and
# any other service that needs to be publicly available with HTTPS
- traefik-public
volumes:
# Create a volume to store the certificates, there is a constraint to make sure
# Traefik is always deployed to the same Docker node with the same volume containing
# the HTTPS certificates
traefik-public-certificates:
networks:
# Use the previously created public network "traefik-public", shared with other
# services that need to be publicly available via this Traefik
traefik-public:
external: true
dynamic config: config.yml
http:
routers:
traefik:
rule: "Host(`traefik.domain.de`)"
service: api@internal
entryPoints:
- "web"
- "websecure"
middlewares:
- "admin-auth"
- "https-redirect"
tls:
certResolver: production
middlewares:
https-redirect:
redirectScheme:
scheme: https
permanent: true
admin-auth:
basicAuth:
removeHeader: true
users:
- "{{env "ADMIN_USERNAME"}}:{{env "ADMIN_HASHED_PASSWORD"}}"
static config: traefik.yml
global:
checkNewVersion: true
sendAnonymousUsage: false # true by default
# (Optional) Log information
# ---
log:
level: DEBUG # DEBUG, INFO, WARNING, ERROR, CRITICAL
format: common # common, json, logfmt
filePath: /var/log/traefik/traefik.log
# (Optional) Accesslog
# ---
accesslog:
format: common # common, json, logfmt
filePath: /var/log/traefik/access.log
# (Optional) Enable API and Dashboard
# ---
api:
dashboard: true # true by default
# Entry Points configuration
# ---
entryPoints:
web:
address: :80
# (Optional) Redirect to HTTPS
# ---
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
# Configure your CertificateResolver here...
# ---
certificatesResolvers:
staging:
acme:
email: example@example.de
storage: /etc/traefik/certs/acme.json
caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
httpChallenge:
entryPoint: web
production:
acme:
email: example@example.de
storage: /etc/traefik/certs/acme.json
httpChallenge:
entryPoint: web
providers:
docker:
exposedByDefault: false # Default is true
file:
# watch for dynamic configuration changes
filename: /etc/traefik/config.yml
watch: true
pilot:
token: "MY-PILOT-TOKEN"