Closed jpilet closed 2 weeks ago
Hello, it seems the docker API is flaky https://community.traefik.io/t/middleware-is-sometimes-not-found-when-defined-in-the-traefik-services-docker-labels/15979/11 and the preferred usage would be using the file provider. You can find the one used here: https://github.com/darkweak/souin/tree/master/plugins/traefik
# compose.yaml
version: '3.4'
services:
traefik:
image: traefik:v3.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/traefik.yml
- ./souin-configuration.yaml:/souin-configuration.yaml
ports:
- 80:80
- 8080:8080
whoami:
image: traefik/whoami
labels:
- traefik.http.routers.whoami.rule=Host(`domain.com`)
# traefik.yml
providers:
file:
filename: /souin-configuration.yaml
watch: true
api:
dashboard: true
debug: true
insecure: true
pilot:
token: 2dfb46d0-ad2a-4792-8b8e-8305dbc4e212
experimental:
plugins:
souin:
moduleName: github.com/darkweak/souin
version: v1.6.50
log:
level: DEBUG
accessLog: {}
# souin-configuration.yaml
http:
routers:
whoami:
middlewares:
- souin
entrypoints:
- http
service: whoami
rule: Host(`domain.com`)
services:
whoami:
loadBalancer:
servers:
- url: http://whoami
passHostHeader: false
middlewares:
souin:
plugin:
souin:
api:
souin: {}
default_cache:
ttl: 10s
allowed_http_verbs: [GET, HEAD, POST]
log_level: debug
I am trying to get a minimal docker compose to run the traefik plugin.
Here's my compose file:
traefik.yml:
souin.yml:
When I run
docker compose up
, I get:and then... nothing. traefik does not really start, it hangs forever, without any log message. I tried several combinations of traefik and souin versions, but no luck.
Am I doing something wrong, or is there a bug in the plugin loading?