blob: 898ba0b5363ccebf7aa5496c05ce2c6f53094ecb [file] [log] [blame]
Akron48407a42023-10-24 12:37:04 +02001volumes:
2 example-index:
Akronb03d67b2022-02-02 11:54:53 +01003services:
Akron48407a42023-10-24 12:37:04 +02004 examplecontainer:
Akron392bc872024-02-20 15:31:58 +01005 image: "korap/example-index:0.1"
Akron48407a42023-10-24 12:37:04 +02006 profiles:
7 - example
8 volumes:
9 - "example-index:/kustvakt/index"
10 restart: "no"
Akronb03d67b2022-02-02 11:54:53 +010011 kalamar:
Akronb3979222025-10-02 12:18:09 +020012 image: "korap/kalamar:v0.64"
Akronb03d67b2022-02-02 11:54:53 +010013 ports:
14 - "64543:64543"
15 environment:
16 KALAMAR_API: "http://kustvakt:8089/api/"
Akronb3979222025-10-02 12:18:09 +020017 COMPOSE_PROFILES: ${COMPOSE_PROFILES}
Akron62f16082022-11-21 16:36:58 +010018 depends_on:
19 - kustvakt
20 profiles:
21 - lite
Akronb3979222025-10-02 12:18:09 +020022 entrypoint: []
23 command: >
24 sh -c '
25 if echo "$$COMPOSE_PROFILES" | grep -q "export"; then
26 echo "Hacking in selective CSP policy...";
27 if ! grep -q "script-src.*unsafe-inline" /kalamar/kalamar.production.conf; then
28 cat /kalamar/kalamar.production.conf | perl -pe "s/\\{/\\{CSP=>{q!frame-src!=>[q!self!]},/" > /kalamar/kalamar.production.tmp.conf;
29 mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf;
30 fi;
31 # Should better be retrieved by the export plugin service using curl
32 PLUGINJSON="{ name => \"Export\", desc => \"Exports Kalamar results\", embed => [{ panel => \"result\", title => \"exports KWICs and snippets\" , icon => \"\134x{f019}\", classes => [\"button-icon\",\"plugin\"], onClick => { action => \"addWidget\", template => \"/plugin/export/export\", permissions => [\"forms\",\"scripts\", \"downloads\" ]}}]},";
33 PLUGINPROXY="{ root_path => \"/plugin/export/\", mount => \"http://kalamar-export:7777/\", service => \"export-plugin-proxy\" },";
34 if ! grep -F -q "/plugin/export/export" /kalamar/kalamar.production.conf; then
35 cat /kalamar/kalamar.production.conf | perl -pe "s!\047PLUGIN_STUB\047!$$PLUGINJSON\047PLUGIN_STUB\047!;" > /kalamar/kalamar.production.tmp.conf;
36 mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf
37 fi;
38 if ! grep -F -q "export-plugin-proxy" /kalamar/kalamar.production.conf; then
39 cat /kalamar/kalamar.production.conf | perl -pe "s!\047PROXY_STUB\047!$$PLUGINPROXY\047PROXY_STUB\047!;" > /kalamar/kalamar.production.tmp.conf;
40 mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf
41 fi;
42 cat /kalamar/kalamar.production.conf;
43 fi || true; perl script/kalamar daemon -l http://0.0.0.0:64543'
Akron0268a9f2023-02-06 09:50:54 +010044 restart: "unless-stopped"
Akron62f16082022-11-21 16:36:58 +010045 full-init:
Akronf18b5a82024-08-12 10:38:04 +020046 image: "korap/kalamar:latest"
Akron62f16082022-11-21 16:36:58 +010047 command: super_client_info kalamar /kalamar/data/super_client_info
48 volumes:
49 - type: bind
Akron035ec442023-12-13 13:28:29 +010050 source: "${PWD}/data/"
Akron62f16082022-11-21 16:36:58 +010051 target: "/kalamar/data"
52 profiles:
53 - full
54 - init
55 user: root
Akron0268a9f2023-02-06 09:50:54 +010056 restart: "no"
Akron62f16082022-11-21 16:36:58 +010057 kalamar-full:
Akronf18b5a82024-08-12 10:38:04 +020058 image: "korap/kalamar:latest"
Akron62f16082022-11-21 16:36:58 +010059 ports:
60 - "64543:64543"
61 environment:
62 KALAMAR_API: "http://kustvakt-full:8089/api/"
Akron80f22522024-09-02 12:35:21 +020063 KALAMAR_PLUGINS: "Auth"
64 KALAMAR_CLIENT_FILE: "/kalamar/super_client_info"
Akron62f16082022-11-21 16:36:58 +010065 volumes:
Akronf24a6182024-09-03 17:20:32 +020066 - ${PWD}/data/super_client_info:/kalamar/super_client_info:z
Akron62f16082022-11-21 16:36:58 +010067 depends_on:
68 kustvakt-full:
69 condition: service_started
70 full-init:
71 condition: service_completed_successfully
72 profiles:
73 - full
Akron0268a9f2023-02-06 09:50:54 +010074 restart: "unless-stopped"
Akron035ec442023-12-13 13:28:29 +010075 user: root
Akronb3979222025-10-02 12:18:09 +020076 kalamar-export:
77 image: "korap/kalamar-plugin-export:0.3.4"
78 environment:
79 KALAMAR_EXPORT_API_HOST: "kustvakt"
80 KALAMAR_EXPORT_API_PORT: "8089"
81 KALAMAR_EXPORT_API_SCHEME: "http"
82 KALAMAR_EXPORT_ASSET_HOST: "localhost"
83 KALAMAR_EXPORT_ASSET_PORT: "64543"
84 KALAMAR_EXPORT_ASSET_SCHEME: "http"
85 KALAMAR_EXPORT_SERVER_SCHEME: "http"
86 KALAMAR_EXPORT_SERVER_HOST: "0.0.0.0"
87 KALAMAR_EXPORT_SERVER_PORT: "7777"
88 profiles:
89 - export
90 restart: "unless-stopped"
Akronb03d67b2022-02-02 11:54:53 +010091 kustvakt:
Akron0336ea02022-04-03 21:44:12 +020092 image: "korap/kustvakt:latest"
Akronb03d67b2022-02-02 11:54:53 +010093 expose:
Akron62f16082022-11-21 16:36:58 +010094 - 8089
Akronb03d67b2022-02-02 11:54:53 +010095 volumes:
Marc Kupietz67b47112022-05-29 10:16:26 +020096 - "${INDEX}:/kustvakt/index:z"
Akron62f16082022-11-21 16:36:58 +010097 profiles:
98 - lite
Akron0268a9f2023-02-06 09:50:54 +010099 restart: "unless-stopped"
Akron62f16082022-11-21 16:36:58 +0100100 kustvakt-full:
101 image: "korap/kustvakt:latest-full"
102 expose:
103 - 8089
Akron035ec442023-12-13 13:28:29 +0100104 user: root
Akron62f16082022-11-21 16:36:58 +0100105 volumes:
106 - "${INDEX}:/kustvakt/index:z"
Akron5c859012022-12-06 11:03:32 +0100107 - type: bind
Akron035ec442023-12-13 13:28:29 +0100108 source: "${PWD}/data/"
109 target: /kustvakt/data/
Akron62f16082022-11-21 16:36:58 +0100110 profiles:
111 - full
112 depends_on:
113 full-init:
114 condition: service_completed_successfully
Akron0268a9f2023-02-06 09:50:54 +0100115 restart: "unless-stopped"
Akron62f16082022-11-21 16:36:58 +0100116configs:
117 super_client_info:
Akron5c859012022-12-06 11:03:32 +0100118 external: true