Files
sablier/docs/providers/docker_swarm.md
Alexis Couvreur acfd612bc0 ci: fix pipelines (#418)
* ci: fix pipelines

* fix(proxywasm): bump to go 1.23 and tinygo 0.33

* ci: move to sablierapp/sablier

* ci: replace sablierapp/whoami with acouvreur/whoami

This will use mimic later

* fix wrong whoami image

* update nginx docker image for proxywasm
2024-10-23 18:13:56 -07:00

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: sablierapp/sablier:1.8.1-beta.22
    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.