【Docker項目實戰(zhàn)】使用Docker部署Docspell文檔管理系統(tǒng)
- 1.1 Docspell簡介
- 1.2 Docspell特點
- 2.1 本地環(huán)境規(guī)劃
- 2.2 本次實踐介紹
- 3.1 檢查Docker服務狀態(tài)
- 3.2 檢查Docker版本
- 3.3 檢查docker compose 版本
- 4.1 下載Docspell源碼
- 4.2 查看Docspell源碼目錄
- 4.3 查看docker-compose.yaml文件
- 4.4 拉取Docspell相關(guān)鏡像
- 5.1 創(chuàng)建Docspell相關(guān)容器
- 5.2 檢查Docspell容器狀態(tài)
- 5.3 檢查Docspell容器日志
- 6.1 注冊賬號
- 7.1 上傳文件
- 7.2 查看上傳文件
一、Docspell介紹
1.1 Docspell簡介
- Docspell簡介
Docspell 是一個個人文檔管理器?;蛘哂袝r稱為 “文檔管理系統(tǒng)”(DMS)。您需要掃描儀進行轉(zhuǎn)換 您的論文歸檔。然后,Docspell 可以協(xié)助組織 導致混亂.它可以統(tǒng)一來自掃描儀、電子郵件的文件 和其他來源。它針對家庭使用,即家庭、 家庭以及較小的團體/公司。
1.2 Docspell特點
- 每個帳戶多用戶:每個帳戶(集合體)可以有多個用戶共享 相同的文件。例如,您家庭中的每個人都可以與您的 文件,同時使用自己的帳戶和自己的設(shè)置。
- 使用 OCR 提取文本:從所有文件中提取文本。對于掃描的文檔/圖像,OCR 通過使用 tesseract 來使用。對文本進行分析,并可用于全文檢索。
- 文本分析:使用 ML 算法分析提取的文本,以查找可以自動注釋到文檔的屬性。
- 支持多個文件:Docspell 可以讀取多種文件類型。提取 ZIP 和 EML(電子郵件文件格式)文件并導入其內(nèi)容。
- 轉(zhuǎn)換為 PDF:所有文件都轉(zhuǎn)換為 PDF。不要擔心原件。原始文件也被存儲起來,可以原封不動地下載。從圖像數(shù)據(jù)(通常從掃描儀返回)創(chuàng)建 PDF 時,生成的 PDF 包含提取的文本并且可搜索。
- 全文搜索:所有文件的提取文本和某些屬性(如名稱和注釋)都可用于全文搜索。全文搜索還可用于進一步約束搜索菜單的結(jié)果,您可以在其中按標簽、通訊員等進行搜索。
- 通過電子郵件發(fā)送:用戶可以在應用程序中定義 SMTP 設(shè)置,然后能夠通過電子郵件發(fā)送項目。這通常對與其他人共享很有用。當然,您的地址簿中有電子郵件地址補全。
- 導入郵箱:用戶可以定義 IMAP 設(shè)置,以便 docspell 可以導入他們的電子郵件。這可以根據(jù)計劃定期完成。導入的郵件可以移出到另一個文件夾或刪除。
- 通知:用戶可以通過電子郵件、Matrix 或 Gotify 收到定期執(zhí)行的查詢產(chǎn)生的文檔通知。還可以為特定事件配置通知。
二、本地環(huán)境介紹
2.1 本地環(huán)境規(guī)劃
本次實踐為個人測試環(huán)境,操作系統(tǒng)版本為centos7.6。
2.2 本次實踐介紹
1.本次實踐部署環(huán)境為個人測試環(huán)境,生產(chǎn)環(huán)境請謹慎; 2.在Docker環(huán)境下部署Docspell文檔管理系統(tǒng)。
三、本地環(huán)境檢查
3.1 檢查Docker服務狀態(tài)
檢查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 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相關(guān)鏡像
拉取Docspell相關(guān)鏡像
[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文檔管理系統(tǒng)
5.1 創(chuàng)建Docspell相關(guān)容器
在./docspell/docker/docker-compose目錄下,使用docker-compose.yml部署文件創(chuàng)建Docspell相關(guān)容器。
[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容器狀態(tài)
檢查Docspell容器狀態(tài),確保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
六、訪問Docspell首頁
6.1 注冊賬號
訪問地址:http://192.168.3.166:7880,將IP替換為自己服務器IP地址,進入到Docspell登錄頁。如果無法訪問,則檢查服務器防火墻是否設(shè)置,云服務器的安全組端口是否放行等。
點擊注冊賬號,自定義設(shè)置賬號密碼登錄即可。
七、Docspell的基本使用
7.1 上傳文件
在Docspell儀表盤首頁,點擊上傳文件,再選擇提交即可。
7.2 查看上傳文件
在Docspell首頁,點擊上傳的文件名,即可瀏覽上傳文件。
八、總結(jié)
Docspell是一款功能強大的個人文檔管理器,可幫助您組織、管理和查找各種類型的文檔。它提供多種導入方式和智能搜索功能,同時注重安全性和隱私保護。Docspell能夠協(xié)助個人組織和管理論文、掃描文檔、電子郵件等各種類型的文件,還可以以結(jié)構(gòu)化的方式將這些文檔存儲在一個集中的位置,并輕松地搜索和訪問它們。盡管Docspell不支持中文語言,但對于日常的簡單文檔管理需求來說,已經(jīng)足夠使用了。
作者聲明本文無利益相關(guān),歡迎值友理性交流,和諧討論~
,