Replies: 1 comment
-
Hello @Cloufish ! You were very close of acheiving what you wanted! it looks like you're just missing the actual middleware on your route. While looking at the current documentation I can understand why it's confusing, the documentation is not showing the whole configuration. I will fix that soon. In the meantime, you can always check e2e tests that are located on the folder For traefik it will be See: https://github.com/acouvreur/sablier/tree/main/plugins/traefik/e2e/docker_swarm Now to the solution: Because you've setup you're middleware from the file provider, you can add the following deploy label to your service: services:
rust-book:
container_name: rust-book
image: peaceiris/mdbook:v0.4.28
stdin_open: true
tty: true
ports:
- "80"
networks:
- web
- rust-book
volumes:
- /home/swarm/books/rust-book:/book
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Warsaw
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.rust-book.rule=Host(`rust-book.home`)"
+ - "traefik.http.routers.rust-book.middlewares=my-sablier@file"
- "traefik.http.services.rust-book.loadbalancer.server.port=3000"
- "traefik.docker.network=web"
- "io.portainer.accesscontrol.users=admin"
- "traefik.http.routers.rust-book.tls=true"
- "sablier.enable=true" # I ADDED THIS
- "sablier.group=non-essential" # I ADDED THIS
- "traefik.docker.lbswarm=true" # I ADDED THIS
command:
- serve
- --hostname
- '0.0.0.0' The line
Will let know traefik to attach the middleware to your service. Once attached, if the middleware is properly configured, you should have a request issued to sablier before reaching your service! Let me know if that works. |
Beta Was this translation helpful? Give feedback.
-
I struggle with setting up Sablier Middleware in Traefik.
I use Docker Swarm + Traefik
Probably the culprit lies in traefik-conf.yml
Should I define middleware on top of
entrypoint: http:
?There are a lot of configuration examples in Discussion, but I wanted to stick to the website documentation
web-app docker-compose:
sablier docker-compose:
sablier.yml config:
traefik-conf.yml:
Beta Was this translation helpful? Give feedback.
All reactions