Secure implementation of Traefik
❤️ tested with Qualys SSL Labs
This docker implementation of Traefik was inspired by Dale Picou's Traefik image. There are two key differences between his image and mine:
- Utilizes the latest version of Traefik.
- Implements a secure HTTP middleware that allows all HTTP methods
Docker Hub 📦 https://hub.docker.com/r/brettfitz/traefik
When defining your Traefik service, specify the image and add the provider:
traefik:
image: brettfitz/traefik:latest
...
command:
- --providers.file.filename=/configs/traefik_dynamic_config.yml
To add a middleware, apply the deploy label to your container. @file
with the middleware name, which tells Traefik to use the file provider to find it.
Available middlewares:
- https-redirect
- secure-headers
- secure-headers-all-methods
- secure-headers-no-csp
- compress-content
- "traefik.http.routers.myrouter.middlewares=https-redirect@file"
- "traefik.http.routers.myrouter.middlewares=https-redirect@file, secure-headers@file"
Contact me on Twitter @_brettfitz or submit a GitHub issue!