From 3333e4aea14190bda9b9b9864531d0d3dbbe6743 Mon Sep 17 00:00:00 2001 From: Will Murphy Date: Mon, 21 Nov 2022 11:48:48 -0600 Subject: [PATCH] docker swarm deploy settings for separate DB node --- docker-compose.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 11b0b0b..a176c49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,9 @@ services: deploy: mode: replicated replicas: 4 + placement: + constraints: + - "node.labels.type==web" restart: always ports: - 443:443 @@ -39,6 +42,9 @@ services: deploy: mode: replicated replicas: 34 + placement: + constraints: + - "node.labels.type==web" restart: always env_file: '.env' environment: @@ -52,6 +58,12 @@ services: mongodb: image: mongo:4.2 + deploy: + mode: replicated + replicas: 1 + placement: + constraints: + - "node.labels.type==database" restart: always volumes: - mongo-data:/data/db