| Akron | 48407a4 | 2023-10-24 12:37:04 +0200 | [diff] [blame] | 1 | volumes: |
| 2 | example-index: |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 3 | services: |
| Akron | 48407a4 | 2023-10-24 12:37:04 +0200 | [diff] [blame] | 4 | examplecontainer: |
| Akron | 392bc87 | 2024-02-20 15:31:58 +0100 | [diff] [blame] | 5 | image: "korap/example-index:0.1" |
| Akron | 48407a4 | 2023-10-24 12:37:04 +0200 | [diff] [blame] | 6 | profiles: |
| 7 | - example |
| 8 | volumes: |
| 9 | - "example-index:/kustvakt/index" |
| 10 | restart: "no" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 11 | kalamar: |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame^] | 12 | image: "korap/kalamar:v0.64" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 13 | ports: |
| 14 | - "64543:64543" |
| 15 | environment: |
| 16 | KALAMAR_API: "http://kustvakt:8089/api/" |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame^] | 17 | COMPOSE_PROFILES: ${COMPOSE_PROFILES} |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 18 | depends_on: |
| 19 | - kustvakt |
| 20 | profiles: |
| 21 | - lite |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame^] | 22 | 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' |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 44 | restart: "unless-stopped" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 45 | full-init: |
| Akron | f18b5a8 | 2024-08-12 10:38:04 +0200 | [diff] [blame] | 46 | image: "korap/kalamar:latest" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 47 | command: super_client_info kalamar /kalamar/data/super_client_info |
| 48 | volumes: |
| 49 | - type: bind |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 50 | source: "${PWD}/data/" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 51 | target: "/kalamar/data" |
| 52 | profiles: |
| 53 | - full |
| 54 | - init |
| 55 | user: root |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 56 | restart: "no" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 57 | kalamar-full: |
| Akron | f18b5a8 | 2024-08-12 10:38:04 +0200 | [diff] [blame] | 58 | image: "korap/kalamar:latest" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 59 | ports: |
| 60 | - "64543:64543" |
| 61 | environment: |
| 62 | KALAMAR_API: "http://kustvakt-full:8089/api/" |
| Akron | 80f2252 | 2024-09-02 12:35:21 +0200 | [diff] [blame] | 63 | KALAMAR_PLUGINS: "Auth" |
| 64 | KALAMAR_CLIENT_FILE: "/kalamar/super_client_info" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 65 | volumes: |
| Akron | f24a618 | 2024-09-03 17:20:32 +0200 | [diff] [blame] | 66 | - ${PWD}/data/super_client_info:/kalamar/super_client_info:z |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 67 | depends_on: |
| 68 | kustvakt-full: |
| 69 | condition: service_started |
| 70 | full-init: |
| 71 | condition: service_completed_successfully |
| 72 | profiles: |
| 73 | - full |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 74 | restart: "unless-stopped" |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 75 | user: root |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame^] | 76 | 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" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 91 | kustvakt: |
| Akron | 0336ea0 | 2022-04-03 21:44:12 +0200 | [diff] [blame] | 92 | image: "korap/kustvakt:latest" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 93 | expose: |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 94 | - 8089 |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 95 | volumes: |
| Marc Kupietz | 67b4711 | 2022-05-29 10:16:26 +0200 | [diff] [blame] | 96 | - "${INDEX}:/kustvakt/index:z" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 97 | profiles: |
| 98 | - lite |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 99 | restart: "unless-stopped" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 100 | kustvakt-full: |
| 101 | image: "korap/kustvakt:latest-full" |
| 102 | expose: |
| 103 | - 8089 |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 104 | user: root |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 105 | volumes: |
| 106 | - "${INDEX}:/kustvakt/index:z" |
| Akron | 5c85901 | 2022-12-06 11:03:32 +0100 | [diff] [blame] | 107 | - type: bind |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 108 | source: "${PWD}/data/" |
| 109 | target: /kustvakt/data/ |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 110 | profiles: |
| 111 | - full |
| 112 | depends_on: |
| 113 | full-init: |
| 114 | condition: service_completed_successfully |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 115 | restart: "unless-stopped" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 116 | configs: |
| 117 | super_client_info: |
| Akron | 5c85901 | 2022-12-06 11:03:32 +0100 | [diff] [blame] | 118 | external: true |