【Docker项目实战】使用Docker部署Docspell文档管理系统


一、Docspell介绍

1.1 Docspell简介

  • Docspell简介

Docspell 是一个个人文档管理器。或者有时称为 “文档管理系统”(DMS)。您需要扫描仪进行转换 您的论文归档。然后,Docspell 可以协助组织 导致混乱😉.它可以统一来自扫描仪、电子邮件的文件 和其他来源。它针对家庭使用,即家庭、 家庭以及较小的团体/公司。

1.2 Docspell特点

  • 每个帐户多用户:每个帐户(集合体)可以有多个用户共享 相同的文件。例如,您家庭中的每个人都可以与您的 文件,同时使用自己的帐户和自己的设置。

  • 使用 OCR 提取文本:从所有文件中提取文本。对于扫描的文档/图像,OCR 通过使用 tesseract 来使用。对文本进行分析,并可用于全文检索。

  • 文本分析:使用 ML 算法分析提取的文本,以查找可以自动注释到文档的属性。

  • 支持多个文件:Docspell 可以读取多种文件类型。提取 ZIP 和 EML(电子邮件文件格式)文件并导入其内容。

  • 转换为 PDF:所有文件都转换为 PDF。不要担心原件。原始文件也被存储起来,可以原封不动地下载。从图像数据(通常从扫描仪返回)创建 PDF 时,生成的 PDF 包含提取的文本并且可搜索。

  • 全文搜索:所有文件的提取文本和某些属性(如名称和注释)都可用于全文搜索。全文搜索还可用于进一步约束搜索菜单的结果,您可以在其中按标签、通讯员等进行搜索。

  • 通过电子邮件发送:用户可以在应用程序中定义 SMTP 设置,然后能够通过电子邮件发送项目。这通常对与其他人共享很有用。当然,您的地址簿中有电子邮件地址补全。

  • 导入邮箱:用户可以定义 IMAP 设置,以便 docspell 可以导入他们的电子邮件。这可以根据计划定期完成。导入的邮件可以移出到另一个文件夹或删除。

  • 通知:用户可以通过电子邮件、Matrix 或 Gotify 收到定期执行的查询产生的文档通知。还可以为特定事件配置通知。

二、本地环境介绍

2.1 本地环境规划

本次实践为个人测试环境,操作系统版本为centos7.6。

hostname IP地址 操作系统版本 Docker版本
dokcer 192.168.3.166 centos 7.6 2 20.10.17

2.2 本次实践介绍

1.本次实践部署环境为个人测试环境,生产环境请谨慎; 2.在Docker环境下部署Docspell文档管理系统。

三、本地环境检查

3.1 检查Docker服务状态

检查Docker服务是否正常运行,确保Docker正常运行。

[root@jeven ~]# systemctl status docker ● docker.service - Docker Application Container Engine    Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)    Active: active (running) since Sat 2024-01-06 00:19:21 CST; 1 day 17h ago      Docs: https://docs.docker.com  Main PID: 11737 (dockerd)     Tasks: 37    Memory: 3.5G    CGroup: /system.slice/docker.service 

3.2 检查Docker版本

检查Docker版本

[root@jeven ~]# docker -v Docker version 20.10.17, build 100c701 

3.3 检查docker compose 版本

检查Docker compose版本,确保2.0以上版本。

[root@jeven ~]# docker compose version Docker Compose version v2.6.0 

四、下载Docspell源码

4.1 下载Docspell源码

下载Docspell源码

git clone https://github.com/eikek/docspell.git 

4.2 查看Docspell源码目录

查看Docspell源码目录

[root@jeven ~]# tree -L 1 ./docspell ./docspell ├── artwork ├── build.sbt ├── Changelog.md ├── Contributing.md ├── docker ├── kubernetes ├── LICENSE.txt ├── modules ├── nix ├── NOTICE.txt ├── project ├── README.md ├── tools ├── version.sbt └── website  8 directories, 7 files 

4.3 查看docker-compose.yaml文件

进入./docspell/docker/docker-compose目录

cd docspell/docker/docker-compose/ 

查看docker-compose.yaml文件

version: '3.8' services:    # The restserver and joex containers defined here are configured   # using env variables. Both must connect to the same database and   # solr instance. More information on configuring can be found here:   # https://docspell.org/docs/configure   #   # Please replace the values of the following with a custom secret   # string:   #   # - DOCSPELL_SERVER_ADMIN__ENDPOINT_SECRET   # - DOCSPELL_SERVER_AUTH_SERVER__SECRET   # - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_HEADER__VALUE   #   (use the same value at the consumedir container!)   #   # After creating an account, you may want to set signup mode to   # "closed" or to "invite". When using invite, you must also set   # DOCSPELL_SERVER_BACKEND_SIGNUP_NEW__INVITE__PASSWORD to some   # secret.   restserver:     image: docspell/restserver:latest     container_name: docspell-restserver     restart: unless-stopped     ports:       - "7880:7880"     environment:       - TZ=Europe/Berlin       - DOCSPELL_SERVER_INTERNAL__URL=http://docspell-restserver:7880       - DOCSPELL_SERVER_ADMIN__ENDPOINT_SECRET=admin123       - DOCSPELL_SERVER_AUTH_SERVER__SECRET=       - DOCSPELL_SERVER_BACKEND_JDBC_PASSWORD=dbpass       - DOCSPELL_SERVER_BACKEND_JDBC_URL=jdbc:postgresql://db:5432/dbname       - DOCSPELL_SERVER_BACKEND_JDBC_USER=dbuser       - DOCSPELL_SERVER_BIND_ADDRESS=0.0.0.0       - DOCSPELL_SERVER_FULL__TEXT__SEARCH_ENABLED=true       - DOCSPELL_SERVER_FULL__TEXT__SEARCH_SOLR_URL=http://docspell-solr:8983/solr/docspell       - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_ENABLED=true       - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_ENABLED=true       - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_HEADER__VALUE=integration-password123       - DOCSPELL_SERVER_BACKEND_SIGNUP_MODE=open       - DOCSPELL_SERVER_BACKEND_SIGNUP_NEW__INVITE__PASSWORD=       - DOCSPELL_SERVER_BACKEND_ADDONS_ENABLED=false     depends_on:       - solr       - db    joex:     image: docspell/joex:latest     container_name: docspell-joex     ## For more memory add corresponding arguments, like below. Also see     ## https://docspell.org/docs/configure/#jvm-options     # command:     #   - -J-Xmx3G     restart: unless-stopped     environment:       - TZ=Europe/Berlin       - DOCSPELL_JOEX_APP__ID=joex1       - DOCSPELL_JOEX_PERIODIC__SCHEDULER_NAME=joex1       - DOCSPELL_JOEX_SCHEDULER_NAME=joex1       - DOCSPELL_JOEX_BASE__URL=http://docspell-joex:7878       - DOCSPELL_JOEX_BIND_ADDRESS=0.0.0.0       - DOCSPELL_JOEX_FULL__TEXT__SEARCH_ENABLED=true       - DOCSPELL_JOEX_FULL__TEXT__SEARCH_SOLR_URL=http://docspell-solr:8983/solr/docspell       - DOCSPELL_JOEX_JDBC_PASSWORD=dbpass       - DOCSPELL_JOEX_JDBC_URL=jdbc:postgresql://db:5432/dbname       - DOCSPELL_JOEX_JDBC_USER=dbuser       - DOCSPELL_JOEX_ADDONS_EXECUTOR__CONFIG_RUNNER=docker,trivial       - DOCSPELL_JOEX_CONVERT_HTML__CONVERTER=weasyprint     ports:       - "7878:7878"     depends_on:       - solr       - db     ## Uncomment when using the "docker" runner with addons     # volumes:     #   - /var/run/docker.sock:/var/run/docker.sock     #   - /tmp:/tmp    # The consumedir container watches a directory for files to upload   # to docspell restserver. This uses the `dsc` tool. For information   # on the available options, see `dsc --help`.   # https://github.com/docspell/dsc   #   # The value after `Docspell-Integration` must match the secret   # specified at the restserver via   # DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_HEADER__VALUE.   #   # The --not-matches "**/.*" option is to exclude hidden files.   consumedir:     image: docspell/dsc:latest     container_name: docspell-consumedir     command:       - dsc       - "-d"       - "http://docspell-restserver:7880"       - "watch"       - "--delete"       - "-ir"       - "--not-matches"       - "**/.*"       - "--header"       - "Docspell-Integration:integration-password123"       - "/opt/docs"     restart: unless-stopped     volumes:       - ./docs:/opt/docs     depends_on:       - restserver    db:     image: postgres:16.1     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:9     container_name: docspell-solr     restart: unless-stopped     volumes:       - docspell-solr_data:/var/solr     command:       - bash       - -c       - 'precreate-core docspell; exec solr -f -Dsolr.modules=analysis-extras'     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: 

4.4 拉取Docspell相关镜像

拉取Docspell相关镜像

[root@jeven docker-compose]# docker compose pull [+] Running 5/5  ⠿ joex Pulled                                                                                                         32.9s  ⠿ consumedir Pulled                                                                                                   35.6s  ⠿ db Pulled                                                                                                           18.2s  ⠿ solr Pulled                                                                                                         35.6s  ⠿ restserver Pulled                                                                                                   33.1s 

五、部署Docspell文档管理系统

5.1 创建Docspell相关容器

在./docspell/docker/docker-compose目录下,使用docker-compose.yml部署文件创建Docspell相关容器。

[root@jeven docker-compose]# docker compose up -d [+] Running 5/5  ⠿ Container docspell-solr        Started                                                                              21.7s  ⠿ Container postgres_db          Started                                                                              21.7s  ⠿ Container docspell-joex        Started                                                                              22.0s  ⠿ Container docspell-restserver  Started                                                                              21.9s  ⠿ Container docspell-consumedir  Started                                                                              12.3s 

5.2 检查Docspell容器状态

检查Docspell容器状态,确保Docspell容器正常启动。

[root@jeven docker-compose]# docker compose ps NAME                  COMMAND                  SERVICE             STATUS               PORTS docspell-consumedir   "dsc -d http://docsp…"   consumedir          running docspell-joex         "/opt/joex-entrypoin…"   joex                running (starting)   0.0.0.0:7878->7878/tcp, :::7878->7878/tcp docspell-restserver   "/opt/docspell-rests…"   restserver          running (starting)   0.0.0.0:7880->7880/tcp, :::7880->7880/tcp docspell-solr         "docker-entrypoint.s…"   solr                running (starting)   8983/tcp postgres_db           "docker-entrypoint.s…"   db                  running              5432/tcp 

5.3 检查Docspell容器日志

检查docspell-restserver容器日志,确保docspell服务正常运行。

docker logs docspell-restserver 
【Docker项目实战】使用Docker部署Docspell文档管理系统

六、访问Docspell首页

6.1 注册账号

访问地址:http://192.168.3.166:7880,将IP替换为自己服务器IP地址,进入到Docspell登录页。如果无法访问,则检查服务器防火墙是否设置,云服务器的安全组端口是否放行等。

【Docker项目实战】使用Docker部署Docspell文档管理系统

点击注册账号,自定义设置账号密码登录即可。

【Docker项目实战】使用Docker部署Docspell文档管理系统 【Docker项目实战】使用Docker部署Docspell文档管理系统

七、Docspell的基本使用

7.1 上传文件

在Docspell仪表盘首页,点击上传文件,再选择提交即可。

【Docker项目实战】使用Docker部署Docspell文档管理系统
【Docker项目实战】使用Docker部署Docspell文档管理系统

7.2 查看上传文件

在Docspell首页,点击上传的文件名,即可浏览上传文件。

【Docker项目实战】使用Docker部署Docspell文档管理系统 【Docker项目实战】使用Docker部署Docspell文档管理系统

八、总结

Docspell是一款功能强大的个人文档管理器,可帮助您组织、管理和查找各种类型的文档。它提供多种导入方式和智能搜索功能,同时注重安全性和隐私保护。Docspell能够协助个人组织和管理论文、扫描文档、电子邮件等各种类型的文件,还可以以结构化的方式将这些文档存储在一个集中的位置,并轻松地搜索和访问它们。尽管Docspell不支持中文语言,但对于日常的简单文档管理需求来说,已经足够使用了。


原文始发于微信公众号(运维江湖客):【Docker项目实战】使用Docker部署Docspell文档管理系统

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/275082.html

(0)
码上实战的头像码上实战

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!