Docker-compose for full KorAP

Change-Id: I9f7c0c2f49b38b365312ac421bb53e54af230371
diff --git a/.gitignore b/.gitignore
index 24d01da..0637fd6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,6 @@
 /sandbox
 /index
 /json
-dck.zip
\ No newline at end of file
+dck.zip
+super_client_info
+kalamar.production.conf
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
index 69806b5..4f8c5a0 100644
--- a/Readme.md
+++ b/Readme.md
@@ -28,12 +28,35 @@
 (in this example `index` in the local directory), run
 
 ```shell
-$ INDEX=./index docker-compose up
+$ INDEX=./index docker-compose --profile=lite up
 ```
 
 This will make the frontend be available at
 `localhost:64543`.
 
+To run the service with an additional user management system,
+start the service with
+
+```shell
+$ INDEX=./index docker-compose --profile=full up
+```
+
+This will generate a file called `super_client_info` in the
+current directory that acts as a shared secret between the frontend and the backend.
+To enable this in Kalamar, the configuration file `kalamar.production.conf`
+needs to point to the mounted file, so it requires a configuration along the lines of
+
+```perl
+{
+    Kalamar => {
+        plugins  => ['Auth']
+    },
+    'Kalamar-Auth' => {
+        client_file => '/kalamar/super_client_info'
+    }
+}
+```
+
 
 ## Corpus Conversion
 
diff --git a/compose.yaml b/compose.yaml
index fe91227..afa4f07 100644
--- a/compose.yaml
+++ b/compose.yaml
@@ -6,9 +6,63 @@
       - "64543:64543"
     environment:
       KALAMAR_API: "http://kustvakt:8089/api/"
+    depends_on:
+      - kustvakt
+    profiles:
+      - lite
+  full-init:
+    image: "korap/kalamar:latest-conv"
+    command: super_client_info kalamar /kalamar/data/super_client_info
+    volumes:
+      - type: bind
+        source: "${PWD}"
+        target: "/kalamar/data"
+    profiles:
+      - full
+      - init
+    user: root
+  kalamar-full:
+    image: "korap/kalamar:latest-conv"
+    ports:
+      - "64543:64543"
+    environment:
+      KALAMAR_API: "http://kustvakt-full:8089/api/"
+    volumes:
+      - type: bind
+        source: "${PWD}/kalamar.production.conf"
+        target: "/kalamar/kalamar.production.conf"
+      - type: bind
+        source: "${PWD}/super_client_info"
+        target: /kalamar/super_client_info
+    depends_on:
+      kustvakt-full:
+        condition: service_started
+      full-init:
+        condition: service_completed_successfully
+    profiles:
+      - full
   kustvakt:
     image: "korap/kustvakt:latest"
     expose:
-      - "8089"
+      - 8089
     volumes:
       - "${INDEX}:/kustvakt/index:z"
+    profiles:
+      - lite
+  kustvakt-full:
+    image: "korap/kustvakt:latest-full"
+    expose:
+      - 8089
+    volumes:
+      - "${INDEX}:/kustvakt/index:z"
+      - type: bind
+        source: "${PWD}/super_client_info"
+        target: /kustvakt/client/super_client_info
+    profiles:
+      - full
+    depends_on:
+      full-init:
+        condition: service_completed_successfully
+configs:
+  super_client_info:
+    external: true