# Traefik Static Configuration
# This file defines Traefik's core behavior and entry points

# API and Dashboard
api:
  dashboard: true
  insecure: true  # Dashboard accessible on port 8080 (for dev/testing)

# Entry Points (HTTP and HTTPS)
entryPoints:
  web:
    address: ":80"
    # Redirect HTTP to HTTPS (uncomment in production)
    # http:
    #   redirections:
    #     entryPoint:
    #       to: websecure
    #       scheme: https

  websecure:
    address: ":443"
    # TLS configuration
    http:
      tls:
        options: default

# Providers
providers:
  # Docker provider for automatic service discovery
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false  # Only services with traefik.enable=true
    network: mosaic-public    # Default network for Traefik

  # File provider for additional configurations
  file:
    directory: "/etc/traefik/dynamic"
    watch: true

# Logging
log:
  level: INFO  # DEBUG, INFO, WARN, ERROR
  format: common

# Access Logs
accessLog:
  format: common
  bufferingSize: 100

# Let's Encrypt / ACME (uncomment for production)
# certificatesResolvers:
#   letsencrypt:
#     acme:
#       email: "${TRAEFIK_ACME_EMAIL}"
#       storage: "/letsencrypt/acme.json"
#       httpChallenge:
#         entryPoint: web
