ron's blog

My Traefik config with Docker Compose

Update: I am not using this config on production, but it's a start for yours if you want to.

Traefik is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your existing infrastructure components (Docker, Swarm mode, Kubernetes, Marathon, Consul, Etcd, Rancher, Amazon ECS, ...) and configures itself automatically and dynamically. Pointing Traefik at your orchestrator should be the only configuration step you need.

My config is bassicly just a bunch of bits and pieces from the docs combined into a nice working one


logLevel = "INFO"
defaultEntryPoints = ["https","http"]

  address = ":80"
    entryPoint = "https"
  address = ":443"

email = "YOUR EMAIL HERE ! ! ! ! ! !"
storage = "acme.json"
onHostRule = true
caServer = ""
entryPoint = "https"
  entryPoint = "http"


version: '3'

        image: traefik # The official Traefik docker image
        command: --api --docker # Enables the web UI and tells Traefik to listen to docker
            - "80:80"     # The HTTP port
            - "443:443"
            - "8080:8080" # The Web UI (enabled by --api)
            - ./trafeik.toml:/etc/traefik/traefik.toml
            - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
        image: containous/whoami # A container that exposes an API to show its IP address
            - ""

Have fun.

Contact methods may be found on my main site

Find a mistake? Send the fix or raise an issue with GitHub

© 2019 Ron B