liveBook · Manning

Traefik

As explained in Learn Docker in a Month of Lunches, Second Edition

Traefik is an open-source reverse proxy and load balancer that dynamically configures routing from service metadata and runtime discovery.

Traefik is a container-aware reverse proxy for exposing many applications through standard HTTP and HTTPS ports. It solves the problem of running multiple services without assigning each one a separate public port. section 20.0

Instead of maintaining a static proxy configuration for every application, Traefik watches the Docker Engine through the Docker API. Container labels describe routing rules, and Traefik builds its configuration while it runs. New deployments and configuration changes do not require restarting or reloading the proxy. section 20.4

A practical Traefik workflow includes:

  • Start Traefik and open its dashboard to inspect the routers and proxied applications. section 20.4

Route a container with labels

A service can enable Traefik, match requests for whoami.local, and direct traffic to port 8080 using container labels. Deploying the service causes Traefik to discover it and build the router configuration automatically.

Figure 20.11 The Traefik dashboard shows you the configuration for all the apps being proxied.
figure

Use the dashboard to inspect the routers and application configuration that Traefik has assembled. section 20.4

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains Docker discovery, labels, routing, HTTPS, load balancing, and sticky sessions through runnable workflows rather than proxy internals.
Examples
Uses whoami and image-gallery deployments, dashboard inspection, curl checks, HTTPS routes, scaling, and cookie-based session tests.
What it assumes
Assumes Docker containers and Compose workflows, while introducing reverse-proxy routing and container discovery through practical commands.
What you can do after
Operate Traefik with Docker Compose, label services, verify routes, configure HTTPS, and test balancing across replicas.
How it connects
Connects reverse proxies with Docker API discovery, container labels, HTTPS, load balancing, and sticky sessions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.