From 50a31967f2fa97f36461f8f38b9e0c1a453e9758 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Mon, 9 Sep 2019 10:49:17 +0200
Subject: [PATCH] Make compose file swarm ready.
---
.gitignore | 1 +
docker-compose.yml | 20 ++++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 15670c52..1f94dbe8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
db.env
web.env
+__pycache__
diff --git a/docker-compose.yml b/docker-compose.yml
index cfe5d796..76b1d728 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,13 +5,16 @@ services:
depends_on:
- db
- redis
+ deploy:
+ placement:
+ constraints:
+ - node.role == manager
env_file:
- db.env
- web.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development
ports:
- 5000:5000
- restart: always
volumes:
- /opaque_storage:/opaque_storage
- ./app:/home/opaque/app
@@ -21,17 +24,26 @@ services:
daemon:
depends_on:
- db
+ deploy:
+ placement:
+ constraints:
+ - node.role == manager
env_file: db.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest
- restart: always
volumes:
- $HOME/.docker/config.json:/home/opaque_daemon/.docker/config.json
db:
+ deploy:
+ placement:
+ constraints:
+ - node.role == manager
env_file: db.env
image: postgres:alpine
- restart: always
volumes:
- /opaque_database:/var/lib/postgresql/data
redis:
+ deploy:
+ placement:
+ constraints:
+ - node.role == manager
image: redis:alpine
- restart: always