From d3b3c6289bbff3e9202e950b93c132494e37f344 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 28 Jun 2020 02:12:57 +0200 Subject: [PATCH] Prepare docker setup for fulltext search --- docker/docker-compose.yml | 53 ++++++++++++++++--------- docker/docspell.conf | 21 ++++++++++ docker/joex.dockerfile | 2 +- docker/joex/entrypoint.sh | 6 --- modules/microsite/docs/doc/uploading.md | 4 +- 5 files changed, 58 insertions(+), 28 deletions(-) delete mode 100755 docker/joex/entrypoint.sh diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3d60ec1d..508cea40 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,15 +1,39 @@ version: '3.7' services: restserver: - image: eikek0/docspell:restserver-0.7.0 + image: eikek0/docspell:restserver-latest container_name: docspell-restserver command: /opt/docspell.conf ports: - "7880:7880" volumes: - ${PWD}/docspell.conf:/opt/docspell.conf + environment: + - DOCSPELL_HEADER_VALUE=${DOCSPELL_HEADER_VALUE:-none} depends_on: - db + - solr + joex: + image: eikek0/docspell:joex-latest + container_name: docspell-joex + command: /opt/docspell.conf + ports: + - "7878:7878" + volumes: + - ${PWD}/docspell.conf:/opt/docspell.conf + depends_on: + - db + - solr + consumedir: + image: eikek0/docspell:consumedir-latest + container_name: docspell-consumedir + command: --path /opt/docs -i --iheader "Docspell-Integration:${DOCSPELL_HEADER_VALUE}" -m http://restserver:7880/api/v1/open/integration/item + environment: + - DOCSPELL_HEADER_VALUE=${DOCSPELL_HEADER_VALUE:-none} + volumes: + - ${PWD}/docs:/opt/docs + depends_on: + - restserver db: image: postgres:11.7 container_name: postgres_db @@ -19,26 +43,17 @@ services: - POSTGRES_USER=dbuser - POSTGRES_PASSWORD=dbpass - POSTGRES_DB=dbname - joex: - image: eikek0/docspell:joex-0.7.0 - container_name: docspell-joex - command: /opt/docspell.conf + solr: + image: solr:8 + container_name: docspell-solr ports: - - "7878:7878" + - "8983:8983" volumes: - - ${PWD}/docspell.conf:/opt/docspell.conf - depends_on: - - db - consumedir: - image: eikek0/docspell:consumedir-0.7.0 - container_name: docspell-consumedir - command: --path /opt/docs -m http://restserver:7880/api/v1/open/upload/item/$SOURCE_ID - environment: - - SOURCE_ID=${SOURCE_ID:-none} - volumes: - - ${PWD}/docs:/opt/docs - depends_on: - - restserver + - solr_data:/var/solr + command: + - solr-precreate + - docspell volumes: postgres_data: + solr_data: diff --git a/docker/docspell.conf b/docker/docspell.conf index 7053a037..9086345a 100644 --- a/docker/docspell.conf +++ b/docker/docspell.conf @@ -3,6 +3,21 @@ docspell.server { bind { address = "0.0.0.0" } + integration-endpoint { + enabled = true + http-header { + enabled = true + header-value = ${?DOCSPELL_HEADER_VALUE} + } + } + # Configuration of the full-text search engine. + full-text-search { + enabled = true + recreate-key = "" + solr = { + url = "http://solr:8983/solr/docspell" + } + } backend { jdbc { url = "jdbc:postgresql://db:5432/dbname" @@ -22,6 +37,12 @@ docspell.joex { user = "dbuser" password = "dbpass" } + full-text-search { + enabled = true + solr = { + url = "http://solr:8983/solr/docspell" + } + } scheduler { pool-size = 1 } diff --git a/docker/joex.dockerfile b/docker/joex.dockerfile index 33c678be..4322ff17 100644 --- a/docker/joex.dockerfile +++ b/docker/joex.dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache openjdk11-jre \ && rm docspell.zip \ && apk del curl unzip -COPY joex/entrypoint.sh /opt/entrypoint.sh +COPY entrypoint-joex.sh /opt/entrypoint.sh EXPOSE 7878 diff --git a/docker/joex/entrypoint.sh b/docker/joex/entrypoint.sh deleted file mode 100755 index b7278e7e..00000000 --- a/docker/joex/entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo "Starting unoconv listener" -unoconv -l & - -/opt/docspell-joex-0.7.0/bin/docspell-joex "$@" diff --git a/modules/microsite/docs/doc/uploading.md b/modules/microsite/docs/doc/uploading.md index 1b6d8239..5233a4f3 100644 --- a/modules/microsite/docs/doc/uploading.md +++ b/modules/microsite/docs/doc/uploading.md @@ -106,8 +106,8 @@ be useful to connect other trusted applications to docspell (that run on the same host or network). The endpoint is disabled by default, an admin must change the -`docspell.restserver.integration-endpoint.enabled` flag to `true` in -the [configuration file](configure#rest-server). +`docspell.server.integration-endpoint.enabled` flag to `true` in the +[configuration file](configure#rest-server). If queried by a `GET` request, it returns whether it is enabled and the collective exists.