| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 1 | x-kalamar-export-setup: &export-setup |
| 2 | entrypoint: [] |
| 3 | command: > |
| 4 | sh -c ' |
| 5 | if [ "$$KALAMAR_EXPORT" != "false" ]; then |
| 6 | echo "Hacking in selective CSP policy..."; |
| 7 | if ! grep -q "script-src.*unsafe-inline" /kalamar/kalamar.production.conf; then |
| 8 | cat /kalamar/kalamar.production.conf | perl -pe "s/\\{/\\{CSP=>{q!frame-src!=>[q!self!]},/" > /kalamar/kalamar.production.tmp.conf; |
| 9 | mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf; |
| 10 | fi; |
| 11 | # Should better be retrieved by the export plugin service using curl |
| 12 | 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\" ]}}]},"; |
| 13 | PLUGINPROXY="{ root_path => \"/plugin/export/\", mount => \"http://kalamar-export:7777/\", service => \"export-plugin-proxy\" },"; |
| 14 | if ! grep -F -q "/plugin/export/export" /kalamar/kalamar.production.conf; then |
| 15 | cat /kalamar/kalamar.production.conf | perl -pe "s!\047PLUGIN_STUB\047!$$PLUGINJSON\047PLUGIN_STUB\047!;" > /kalamar/kalamar.production.tmp.conf; |
| 16 | mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf |
| 17 | fi; |
| 18 | if ! grep -F -q "export-plugin-proxy" /kalamar/kalamar.production.conf; then |
| 19 | cat /kalamar/kalamar.production.conf | perl -pe "s!\047PROXY_STUB\047!$$PLUGINPROXY\047PROXY_STUB\047!;" > /kalamar/kalamar.production.tmp.conf; |
| 20 | mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf |
| 21 | fi; |
| 22 | cat /kalamar/kalamar.production.conf; |
| 23 | fi || true; perl script/kalamar daemon -l http://0.0.0.0:64543' |
| Akron | 48407a4 | 2023-10-24 12:37:04 +0200 | [diff] [blame] | 24 | volumes: |
| 25 | example-index: |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 26 | services: |
| Akron | 48407a4 | 2023-10-24 12:37:04 +0200 | [diff] [blame] | 27 | examplecontainer: |
| Akron | 392bc87 | 2024-02-20 15:31:58 +0100 | [diff] [blame] | 28 | image: "korap/example-index:0.1" |
| Akron | 48407a4 | 2023-10-24 12:37:04 +0200 | [diff] [blame] | 29 | profiles: |
| 30 | - example |
| 31 | volumes: |
| 32 | - "example-index:/kustvakt/index" |
| 33 | restart: "no" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 34 | kalamar: |
| Marc Kupietz | fbeafa5 | 2026-08-06 16:14:18 +0200 | [diff] [blame^] | 35 | image: ${KALAMAR_IMAGE:-korap/kalamar:0.65} |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 36 | ports: |
| 37 | - "64543:64543" |
| 38 | environment: |
| 39 | KALAMAR_API: "http://kustvakt:8089/api/" |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 40 | KALAMAR_EXPORT: ${KALAMAR_EXPORT:-true} |
| Marc Kupietz | fbeafa5 | 2026-08-06 16:14:18 +0200 | [diff] [blame^] | 41 | volumes: |
| 42 | # Templates describing your own corpus; see custom/README.md. |
| 43 | - ${KALAMAR_TEMPLATES:-./custom}:/kalamar/templates/custom:ro |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 44 | depends_on: |
| 45 | - kustvakt |
| 46 | profiles: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 47 | - open |
| 48 | <<: *export-setup |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 49 | restart: "unless-stopped" |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 50 | auth-init: |
| Akron | f18b5a8 | 2024-08-12 10:38:04 +0200 | [diff] [blame] | 51 | image: "korap/kalamar:latest" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 52 | command: super_client_info kalamar /kalamar/data/super_client_info |
| 53 | volumes: |
| 54 | - type: bind |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 55 | source: "${PWD}/data/" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 56 | target: "/kalamar/data" |
| 57 | profiles: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 58 | - auth |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 59 | - init |
| 60 | user: root |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 61 | restart: "no" |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 62 | kalamar-auth: |
| Akron | f18b5a8 | 2024-08-12 10:38:04 +0200 | [diff] [blame] | 63 | image: "korap/kalamar:latest" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 64 | ports: |
| 65 | - "64543:64543" |
| 66 | environment: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 67 | KALAMAR_API: "http://kustvakt-auth:8089/api/" |
| Akron | 80f2252 | 2024-09-02 12:35:21 +0200 | [diff] [blame] | 68 | KALAMAR_PLUGINS: "Auth" |
| 69 | KALAMAR_CLIENT_FILE: "/kalamar/super_client_info" |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 70 | KALAMAR_EXPORT: ${KALAMAR_EXPORT:-true} |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 71 | volumes: |
| Akron | f24a618 | 2024-09-03 17:20:32 +0200 | [diff] [blame] | 72 | - ${PWD}/data/super_client_info:/kalamar/super_client_info:z |
| Marc Kupietz | fbeafa5 | 2026-08-06 16:14:18 +0200 | [diff] [blame^] | 73 | # Templates describing your own corpus; see custom/README.md. |
| 74 | - ${KALAMAR_TEMPLATES:-./custom}:/kalamar/templates/custom:ro |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 75 | depends_on: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 76 | kustvakt-auth: |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 77 | condition: service_started |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 78 | auth-init: |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 79 | condition: service_completed_successfully |
| 80 | profiles: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 81 | - auth |
| 82 | <<: *export-setup |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 83 | restart: "unless-stopped" |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 84 | user: root |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame] | 85 | kalamar-export: |
| Marc Kupietz | b1b1f45 | 2026-02-25 10:26:25 +0100 | [diff] [blame] | 86 | image: "korap/kalamar-plugin-export:0.4.1" |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame] | 87 | environment: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 88 | KALAMAR_EXPORT_API_HOST: "kustvakt-api" |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame] | 89 | KALAMAR_EXPORT_API_PORT: "8089" |
| 90 | KALAMAR_EXPORT_API_SCHEME: "http" |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame] | 91 | KALAMAR_EXPORT_SERVER_SCHEME: "http" |
| 92 | KALAMAR_EXPORT_SERVER_HOST: "0.0.0.0" |
| 93 | KALAMAR_EXPORT_SERVER_PORT: "7777" |
| 94 | profiles: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 95 | - open |
| 96 | - auth |
| Akron | b397922 | 2025-10-02 12:18:09 +0200 | [diff] [blame] | 97 | - export |
| 98 | restart: "unless-stopped" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 99 | kustvakt: |
| Akron | 0336ea0 | 2022-04-03 21:44:12 +0200 | [diff] [blame] | 100 | image: "korap/kustvakt:latest" |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 101 | expose: |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 102 | - 8089 |
| Akron | b03d67b | 2022-02-02 11:54:53 +0100 | [diff] [blame] | 103 | volumes: |
| Marc Kupietz | 67b4711 | 2022-05-29 10:16:26 +0200 | [diff] [blame] | 104 | - "${INDEX}:/kustvakt/index:z" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 105 | profiles: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 106 | - open |
| 107 | networks: |
| 108 | default: |
| 109 | aliases: |
| 110 | - kustvakt-api |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 111 | restart: "unless-stopped" |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 112 | kustvakt-auth: |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 113 | image: "korap/kustvakt:latest-full" |
| 114 | expose: |
| 115 | - 8089 |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 116 | user: root |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 117 | volumes: |
| 118 | - "${INDEX}:/kustvakt/index:z" |
| Akron | 5c85901 | 2022-12-06 11:03:32 +0100 | [diff] [blame] | 119 | - type: bind |
| Akron | 035ec44 | 2023-12-13 13:28:29 +0100 | [diff] [blame] | 120 | source: "${PWD}/data/" |
| 121 | target: /kustvakt/data/ |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 122 | profiles: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 123 | - auth |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 124 | depends_on: |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 125 | auth-init: |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 126 | condition: service_completed_successfully |
| Marc Kupietz | ee60e00 | 2026-02-25 14:27:28 +0100 | [diff] [blame] | 127 | networks: |
| 128 | default: |
| 129 | aliases: |
| 130 | - kustvakt-api |
| Akron | 0268a9f | 2023-02-06 09:50:54 +0100 | [diff] [blame] | 131 | restart: "unless-stopped" |
| Akron | 62f1608 | 2022-11-21 16:36:58 +0100 | [diff] [blame] | 132 | configs: |
| 133 | super_client_info: |
| Akron | 5c85901 | 2022-12-06 11:03:32 +0100 | [diff] [blame] | 134 | external: true |