mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-31 01:57:28 +01:00
This feature adds the capability to stop unregistered running instances upon startup. Previously, you had to stop running instances manually or issue an initial request that will shut down instances afterwards. With this change, all discovered instances will be shutdown. They need to be registered using labels. E.g.: sablier.enable=true Fixes #153
79 lines
3.6 KiB
YAML
79 lines
3.6 KiB
YAML
version: "3.7"
|
|
|
|
services:
|
|
traefik:
|
|
image: traefik:v3.0.4
|
|
command:
|
|
- --experimental.localPlugins.sablier.moduleName=github.com/acouvreur/sablier
|
|
- --entryPoints.http.address=:80
|
|
- --providers.docker=true
|
|
- --providers.file.filename=/etc/traefik/dynamic-config.yml
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
- '../../../..:/plugins-local/src/github.com/acouvreur/sablier'
|
|
- './dynamic-config.yml:/etc/traefik/dynamic-config.yml'
|
|
restart: "no"
|
|
|
|
sablier:
|
|
image: acouvreur/sablier:local
|
|
command:
|
|
- start
|
|
- --provider.name=docker
|
|
- --logging.level=trace
|
|
volumes:
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
labels:
|
|
- traefik.enable=true
|
|
# Dynamic Middleware
|
|
- traefik.http.middlewares.dynamic.plugin.sablier.names=docker_classic_e2e-whoami-1
|
|
- traefik.http.middlewares.dynamic.plugin.sablier.sablierUrl=http://sablier:10000
|
|
- traefik.http.middlewares.dynamic.plugin.sablier.sessionDuration=1m
|
|
- traefik.http.middlewares.dynamic.plugin.sablier.dynamic.DisplayName=Dynamic Whoami
|
|
- traefik.http.middlewares.dynamic.plugin.sablier.dynamic.theme=hacker-terminal
|
|
# Blocking Middleware
|
|
- traefik.http.middlewares.blocking.plugin.sablier.names=docker_classic_e2e-whoami-1
|
|
- traefik.http.middlewares.blocking.plugin.sablier.sablierUrl=http://sablier:10000
|
|
- traefik.http.middlewares.blocking.plugin.sablier.sessionDuration=1m
|
|
- traefik.http.middlewares.blocking.plugin.sablier.blocking.timeout=30s
|
|
# Multiple Dynamic Middleware
|
|
- traefik.http.middlewares.multiple.plugin.sablier.names=docker_classic_e2e-whoami-1,docker_classic_e2e-nginx-1
|
|
- traefik.http.middlewares.multiple.plugin.sablier.sablierUrl=http://sablier:10000
|
|
- traefik.http.middlewares.multiple.plugin.sablier.sessionDuration=1m
|
|
- traefik.http.middlewares.multiple.plugin.sablier.dynamic.displayName=Multiple Whoami
|
|
# Healthy Middleware
|
|
- traefik.http.middlewares.healthy.plugin.sablier.names=docker_classic_e2e-nginx-1
|
|
- traefik.http.middlewares.healthy.plugin.sablier.sablierUrl=http://sablier:10000
|
|
- traefik.http.middlewares.healthy.plugin.sablier.sessionDuration=1m
|
|
- traefik.http.middlewares.healthy.plugin.sablier.dynamic.displayName=Healthy Nginx
|
|
# Group Middleware
|
|
- traefik.http.middlewares.group.plugin.sablier.group=E2E
|
|
- traefik.http.middlewares.group.plugin.sablier.sablierUrl=http://sablier:10000
|
|
- traefik.http.middlewares.group.plugin.sablier.sessionDuration=1m
|
|
- traefik.http.middlewares.group.plugin.sablier.dynamic.displayName=Group E2E
|
|
|
|
whoami:
|
|
image: containous/whoami:v1.5.0
|
|
# Cannot use labels because as soon as the container is stopped, the labels are not treated by Traefik
|
|
# The route doesn't exist anymore. Use dynamic-config.yml file instead.
|
|
labels:
|
|
- sablier.enable=true
|
|
- sablier.group=E2E
|
|
# - traefik.enable
|
|
# - traefik.http.routers.whoami.rule=PathPrefix(`/whoami`)
|
|
# - traefik.http.routers.whoami.middlewares=ondemand
|
|
|
|
nginx:
|
|
image: nginx:1.27.0
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost"]
|
|
interval: 5s
|
|
# Cannot use labels because as soon as the container is stopped, the labels are not treated by Traefik
|
|
# The route doesn't exist anymore. Use dynamic-config.yml file instead.
|
|
labels:
|
|
- sablier.enable=true
|
|
- sablier.group=E2E
|
|
# - traefik.enable
|
|
# - traefik.http.routers.nginx.rule=PathPrefix(`/nginx`)
|
|
# - traefik.http.routers.nginx.middlewares=ondemand |