| volumes: |
| example-index: |
| services: |
| examplecontainer: |
| image: "korap/example-index:0.1" |
| profiles: |
| - example |
| volumes: |
| - "example-index:/kustvakt/index" |
| restart: "no" |
| kalamar: |
| image: "korap/kalamar:v0.64" |
| ports: |
| - "64543:64543" |
| environment: |
| KALAMAR_API: "http://kustvakt:8089/api/" |
| COMPOSE_PROFILES: ${COMPOSE_PROFILES} |
| depends_on: |
| - kustvakt |
| profiles: |
| - lite |
| entrypoint: [] |
| command: > |
| sh -c ' |
| if echo "$$COMPOSE_PROFILES" | grep -q "export"; then |
| echo "Hacking in selective CSP policy..."; |
| if ! grep -q "script-src.*unsafe-inline" /kalamar/kalamar.production.conf; then |
| cat /kalamar/kalamar.production.conf | perl -pe "s/\\{/\\{CSP=>{q!frame-src!=>[q!self!]},/" > /kalamar/kalamar.production.tmp.conf; |
| mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf; |
| fi; |
| # Should better be retrieved by the export plugin service using curl |
| 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\" ]}}]},"; |
| PLUGINPROXY="{ root_path => \"/plugin/export/\", mount => \"http://kalamar-export:7777/\", service => \"export-plugin-proxy\" },"; |
| if ! grep -F -q "/plugin/export/export" /kalamar/kalamar.production.conf; then |
| cat /kalamar/kalamar.production.conf | perl -pe "s!\047PLUGIN_STUB\047!$$PLUGINJSON\047PLUGIN_STUB\047!;" > /kalamar/kalamar.production.tmp.conf; |
| mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf |
| fi; |
| if ! grep -F -q "export-plugin-proxy" /kalamar/kalamar.production.conf; then |
| cat /kalamar/kalamar.production.conf | perl -pe "s!\047PROXY_STUB\047!$$PLUGINPROXY\047PROXY_STUB\047!;" > /kalamar/kalamar.production.tmp.conf; |
| mv /kalamar/kalamar.production.tmp.conf /kalamar/kalamar.production.conf |
| fi; |
| cat /kalamar/kalamar.production.conf; |
| fi || true; perl script/kalamar daemon -l http://0.0.0.0:64543' |
| restart: "unless-stopped" |
| full-init: |
| image: "korap/kalamar:latest" |
| command: super_client_info kalamar /kalamar/data/super_client_info |
| volumes: |
| - type: bind |
| source: "${PWD}/data/" |
| target: "/kalamar/data" |
| profiles: |
| - full |
| - init |
| user: root |
| restart: "no" |
| kalamar-full: |
| image: "korap/kalamar:latest" |
| ports: |
| - "64543:64543" |
| environment: |
| KALAMAR_API: "http://kustvakt-full:8089/api/" |
| KALAMAR_PLUGINS: "Auth" |
| KALAMAR_CLIENT_FILE: "/kalamar/super_client_info" |
| volumes: |
| - ${PWD}/data/super_client_info:/kalamar/super_client_info:z |
| depends_on: |
| kustvakt-full: |
| condition: service_started |
| full-init: |
| condition: service_completed_successfully |
| profiles: |
| - full |
| restart: "unless-stopped" |
| user: root |
| kalamar-export: |
| image: "korap/kalamar-plugin-export:0.4.1" |
| environment: |
| KALAMAR_EXPORT_API_HOST: "kustvakt" |
| KALAMAR_EXPORT_API_PORT: "8089" |
| KALAMAR_EXPORT_API_SCHEME: "http" |
| KALAMAR_EXPORT_ASSET_HOST: "localhost" |
| KALAMAR_EXPORT_ASSET_PORT: "64543" |
| KALAMAR_EXPORT_ASSET_SCHEME: "http" |
| KALAMAR_EXPORT_SERVER_SCHEME: "http" |
| KALAMAR_EXPORT_SERVER_HOST: "0.0.0.0" |
| KALAMAR_EXPORT_SERVER_PORT: "7777" |
| profiles: |
| - export |
| restart: "unless-stopped" |
| kustvakt: |
| image: "korap/kustvakt:latest" |
| expose: |
| - 8089 |
| volumes: |
| - "${INDEX}:/kustvakt/index:z" |
| profiles: |
| - lite |
| restart: "unless-stopped" |
| kustvakt-full: |
| image: "korap/kustvakt:latest-full" |
| expose: |
| - 8089 |
| user: root |
| volumes: |
| - "${INDEX}:/kustvakt/index:z" |
| - type: bind |
| source: "${PWD}/data/" |
| target: /kustvakt/data/ |
| profiles: |
| - full |
| depends_on: |
| full-init: |
| condition: service_completed_successfully |
| restart: "unless-stopped" |
| configs: |
| super_client_info: |
| external: true |