Initial commit.
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
db/
|
||||||
|
html/
|
||||||
37
README.md
Normal file
37
README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
= Nextcloud with OCR and Elasticsearch for Full-Text Searching
|
||||||
|
|
||||||
|
To get elasticsearch to run, you'll need to run this on the host:
|
||||||
|
sysctl -w vm.max_map_count=262144
|
||||||
|
|
||||||
|
You can build and start all three containers (nextcloud, db and elasticsearch) with:
|
||||||
|
|
||||||
|
$docker-compose up
|
||||||
|
|
||||||
|
Go to: http://[host]:9900/
|
||||||
|
|
||||||
|
Make up user/pass, I uncheck installing the additional apps at the bottom
|
||||||
|
|
||||||
|
Disable dashboard under user > settings
|
||||||
|
|
||||||
|
== OCR
|
||||||
|
1. go into settings > basic settings > set cron
|
||||||
|
1. install apps (workflow ocr)
|
||||||
|
1. create flow:
|
||||||
|
2. add new ocr flow
|
||||||
|
2. when: file created
|
||||||
|
2. file mime type > is > pdf document
|
||||||
|
2. (USE IS AND NOT MATCHES!!!)
|
||||||
|
|
||||||
|
== Full text
|
||||||
|
|
||||||
|
1. Install apps (full text, full text elastic, full text - files)
|
||||||
|
1. To to Settings > Full Text Search
|
||||||
|
1. Configure settings appropriately. Address is: http://user:pass@elasticsearch:9200/
|
||||||
|
1. Now you have to run the fulltextsearch index manually one time
|
||||||
|
2. shell into container, enable www-data account (chsh)
|
||||||
|
2. go to /var/www/html and run: php occ fulltextsearch:index
|
||||||
|
2. disable www-data account (chsh back to nologin)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
34
docker-compose.yml
Normal file
34
docker-compose.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
nextcloud_db:
|
||||||
|
image: mariadb
|
||||||
|
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./db:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=hELLO@123
|
||||||
|
- MYSQL_PASSWORD=hELLO@123
|
||||||
|
- MYSQL_DATABASE=nextcloud
|
||||||
|
- MYSQL_USER=nextcloud
|
||||||
|
|
||||||
|
nextcloud:
|
||||||
|
image: nextcloud-ocr
|
||||||
|
build: ./docker/nextcloud
|
||||||
|
ports:
|
||||||
|
- 9900:80
|
||||||
|
links:
|
||||||
|
- nextcloud_db
|
||||||
|
volumes:
|
||||||
|
- ./html:/var/www/html
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
elasticsearch:
|
||||||
|
image: nextcloud-es
|
||||||
|
build: ./docker/elasticsearch
|
||||||
|
ports:
|
||||||
|
- 9200
|
||||||
|
environment:
|
||||||
|
- "discovery.type=single-node"
|
||||||
|
|
||||||
|
|
||||||
2
docker/elasticsearch/Dockerfile
Normal file
2
docker/elasticsearch/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
FROM elasticsearch:7.14.1
|
||||||
|
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install -b ingest-attachment
|
||||||
19
docker/nextcloud/Dockerfile
Normal file
19
docker/nextcloud/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
FROM nextcloud
|
||||||
|
|
||||||
|
# install necessary packages
|
||||||
|
RUN apt-get update && apt-get install -y ocrmypdf supervisor
|
||||||
|
|
||||||
|
# create supervisord dir
|
||||||
|
RUN mkdir /var/log/supervisord /var/run/supervisord
|
||||||
|
COPY supervisord.conf /
|
||||||
|
|
||||||
|
# copy in memory size increase php ini file
|
||||||
|
# we name it zzz because nextcloud.ini was overriding
|
||||||
|
COPY zzz-memory-limit.ini /usr/local/etc/php/conf.d/
|
||||||
|
|
||||||
|
# remove memory limit from nextcloud.ini that overrides that
|
||||||
|
# todo
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
23
docker/nextcloud/supervisord.conf
Normal file
23
docker/nextcloud/supervisord.conf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/var/log/supervisord/supervisord.log
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
childlogdir=/var/log/supervisord/
|
||||||
|
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||||
|
logfile_backups=10 ; number of backed up logfiles
|
||||||
|
loglevel=error
|
||||||
|
|
||||||
|
[program:apache2]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=apache2-foreground
|
||||||
|
|
||||||
|
[program:cron]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=/cron.sh
|
||||||
|
|
||||||
1
docker/nextcloud/zzz-memory-limit.ini
Normal file
1
docker/nextcloud/zzz-memory-limit.ini
Normal file
@@ -0,0 +1 @@
|
|||||||
|
memory_limit=1G
|
||||||
Reference in New Issue
Block a user