mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-21 13:23:03 +01:00
1.4 KiB
1.4 KiB
Docker Swarm
The Docker Swarm provider communicates with the docker.sock socket to scale services on demand.
Use the Docker Swarm provider
In order to use the docker swarm provider you can configure the provider.name property.
File (YAML)
provider:
name: docker_swarm # or swarm
CLI
sablier start --provider.name=docker_swarm # or swarm
Environment Variable
PROVIDER_NAME=docker_swarm # or swarm
!> Ensure that Sablier has access to the docker socket!
services:
sablier:
image: acouvreur/sablier:1.8.0-beta.14
command:
- start
- --provider.name=docker_swarm # or swarm
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
Register services
For Sablier to work, it needs to know which docker services to scale up and down.
You have to register your services by opting-in with labels.
services:
whoami:
image: acouvreur/whoami:v1.10.2
deploy:
labels:
- sablier.enable=true
- sablier.group=mygroup
How does Sablier knows when a service is ready?
Sablier checks for the service replicas. As soon as the current replicas matches the wanted replicas, then the service is considered ready.
?> Docker Swarm uses the container's healthcheck to check if the container is up and running. So the provider has a native healthcheck support.