Skip to content

Instantly share code, notes, and snippets.

@axelbdt
Created April 17, 2025 01:50
Show Gist options
  • Save axelbdt/588b3978879abb45d16144ccd59984dc to your computer and use it in GitHub Desktop.
Save axelbdt/588b3978879abb45d16144ccd59984dc to your computer and use it in GitHub Desktop.
Docker Swarm to run a Restate.dev cluster
version: "3"
services:
restate-1:
<<: *defaults
ports:
- target: 8080
published: 80
protocol: tcp
mode: host
environment:
<<: *common-env
RESTATE_NODE_NAME: restate-1
RESTATE_FORCE_NODE_ID: 1
RESTATE_ADVERTISED_ADDRESS: "http://${NODE_IP}:5122"
RESTATE_AUTO_PROVISION: "true"
deploy:
placement:
constraints: [node.role == manager]
resources:
limits:
memory: 2G
restate-2:
<<: *defaults
ports:
- target: 5122
published: 25122
protocol: tcp
mode: host
environment:
<<: *common-env
RESTATE_NODE_NAME: restate-2
RESTATE_FORCE_NODE_ID: 2
RESTATE_ADVERTISED_ADDRESS: "http://${NODE_IP}:25122"
RESTATE_AUTO_PROVISION: "false"
deploy:
placement:
constraints: [node.role == worker]
resources:
limits:
memory: 2G
restate-3:
<<: *defaults
ports:
- target: 5122
published: 35122
protocol: tcp
mode: host
environment:
<<: *common-env
RESTATE_NODE_NAME: restate-3
RESTATE_FORCE_NODE_ID: 3
RESTATE_ADVERTISED_ADDRESS: "http://${NODE_IP}:35122"
RESTATE_AUTO_PROVISION: "false"
deploy:
placement:
constraints: [node.role == worker]
resources:
limits:
memory: 2G
minio:
image: quay.io/minio/minio
entrypoint: "/bin/sh"
command: "-c 'mkdir -p /data/restate && /usr/bin/minio server --quiet /data'"
ports:
- target: 9000
published: 9000
protocol: tcp
mode: host
deploy:
placement:
constraints: [node.role == manager]
resources:
limits:
memory: 1G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment