Rework docker setup

This commit is contained in:
eikek
2021-05-31 00:07:11 +02:00
parent c0402b1f92
commit b122d9eab0
8 changed files with 326 additions and 0 deletions

View File

@ -0,0 +1,2 @@
TZ=Europe/Berlin
DOCSPELL_HEADER_VALUE=none

View File

@ -0,0 +1,80 @@
version: '3.8'
services:
restserver:
image: docspell/restserver:latest
container_name: docspell-restserver
command:
- /opt/docspell.conf
restart: unless-stopped
ports:
- "7880:7880"
volumes:
- ./docspell.conf:/opt/docspell.conf
env_file: ./.env
depends_on:
- solr
joex:
image: docspell/joex:latest
container_name: docspell-joex
command:
- /opt/docspell.conf
restart: unless-stopped
env_file: ./.env
ports:
- "7878:7878"
volumes:
- ./docspell.conf:/opt/docspell.conf
depends_on:
- solr
consumedir:
image: docspell/tools:latest
container_name: docspell-consumedir
command:
- ds-consumedir
- "-vmdi"
- "--path"
- "/opt/docs"
- "--iheader"
- "Docspell-Integration:$DOCSPELL_HEADER_VALUE"
- "http://docspell-restserver:7880/api/v1/open/integration/item"
restart: unless-stopped
env_file: ./.env
volumes:
- ./docs:/opt/docs
depends_on:
- restserver
db:
image: postgres:13.3
container_name: postgres_db
restart: unless-stopped
volumes:
- docspell-postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=dbpass
- POSTGRES_DB=dbname
solr:
image: solr:8
container_name: docspell-solr
restart: unless-stopped
volumes:
- docspell-solr_data:/var/solr
command:
- solr-precreate
- docspell
healthcheck:
test: ["CMD", "curl", "f", "http://localhost:8983/solr/docspell/admin/ping"]
interval: 1m
timeout: 10s
retries: 2
start_period: 30s
volumes:
docspell-postgres_data:
docspell-solr_data:

View File

@ -0,0 +1,83 @@
# This is the configuration file for docspell. It contains two main
# namespaces: docspell.server and docspell.joex. Each provide the
# config for the respective component.
#
# They can be moved to different files, if necessary. For this example
# though, both components are configured in this single file.
#
# Below are only some settings that differ from the default. Please
# see https://docspell.org/docs/configure/#default-config for all
# options and their documentation. This page provides more
# information about the important config options.
#
# Note: this docker-compose setup is an example to get started. It
# sets up one rest-server, one joex, a postgres database and a solr
# all on the same machine.
# Define settings that are used in multiple places:
db_url="jdbc:postgresql://db:5432/dbname"
db_user="dbuser"
db_pass="dbpass"
solr_url="http://docspell-solr:8983/docspell"
# This configures the restserver
docspell.server {
base-url = "http://localhost:7880"
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
solr = {
url = ${solr_url}
}
}
backend {
jdbc {
url = ${db_url}
user = ${db_user}
password = ${db_pass}
}
}
}
# This configures joex
#
# Note to joex: It is currently setup for one instance. Should you
# want to scale joex instance up (maybe to help processing a batch of
# files), there are two options:
#
# - look at https://github.com/eikek/docspell/pull/552 to elastically
# start and stop joex instances via docker-compose
# - set pool-size to some higher number; this requires to restart joex
#
docspell.joex {
base-url = "http://docspell-joex:7878"
bind {
address = "0.0.0.0"
}
jdbc {
url = ${db_url}
user = ${db_user}
password = ${db_pass}
}
full-text-search {
enabled = true
solr = {
url = ${solr_url}
}
}
scheduler {
pool-size = 1
}
}