From da2f7f6c7d6f32971949cc62d5f57bb472dcf1c3 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Mon, 2 Dec 2019 11:06:46 +0100
Subject: [PATCH] Updates for stack deployment

---
 app/__init__.py         |  2 +-
 docker_stack_deploy.yml | 20 ++++++++------------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/app/__init__.py b/app/__init__.py
index 4b32e927..3a1f54fc 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -23,7 +23,7 @@ def create_app(config_name):
     db.init_app(app)
     login_manager.init_app(app)
     mail.init_app(app)
-    socketio.init_app(app, message_queue='redis://redis:6379')
+    socketio.init_app(app, message_queue='redis://redis:6379/')
 
     from . import events
 
diff --git a/docker_stack_deploy.yml b/docker_stack_deploy.yml
index 62dc689d..dc232c8a 100644
--- a/docker_stack_deploy.yml
+++ b/docker_stack_deploy.yml
@@ -6,6 +6,10 @@ services:
       placement:
         constraints:
           - node.role == manager
+      labels:
+        - com.docker.lb.hosts=web.opaque
+        - com.docker.lb.port=8080
+        - com.docker.lb.sticky_session_cookie=session
     env_file:
       - db.env
       - web.env
@@ -13,7 +17,7 @@ services:
     ports:
       - 5000:5000
     volumes:
-      - storage:/mnt/opaque
+      - /mnt/opaque:/mnt/opaque
       - ./logs:/home/opaque/logs
   daemon:
     deploy:
@@ -25,7 +29,7 @@ services:
       - web.env
     image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest
     volumes:
-      - storage:/mnt/opaque
+      - /mnt/opaque:/mnt/opaque
       - ./logs:/home/opaque_daemon/logs
       - $HOME/.docker/config.json:/home/opaque_daemon/.docker/config.json
   db:
@@ -34,7 +38,7 @@ services:
         constraints:
           - node.role == manager
     env_file: db.env
-    image: postgres:11-alpine
+    image: postgres:11
     volumes:
       - /srv/opaque/database:/var/lib/postgresql/data
   redis:
@@ -42,12 +46,4 @@ services:
       placement:
         constraints:
           - node.role == manager
-    image: redis:alpine
-
-volumes:
-  storage:
-    driver: local
-    driver_opts:
-      device: "//127.0.0.1/opaque_storage"
-      o: "gid=1000,password=opaque,uid=1000,username=opaque"
-      type: cifs
+    image: redis:5
-- 
GitLab