使用 Docker Compose 管理 ONLYOFFICE DocumentServer 的配置与优化实践

在日常部署和维护在线协作平台时,ONLYOFFICE DocumentServer 作为一款强大的在线 Office 解决方案,因其优秀的兼容性和开放性被广泛采用。结合 Docker Compose,可以更灵活地控制服务的生命周期、挂载、更新及安全策略。以下记录一次优化配置和维护的实践过程。 💡 配置背景 在最初的配置中,DocumentServer 容器同时暴露了 HTTP(80)和 HTTPS(443)端口,并在容器内部配置证书。这种方式在单机场景下可以快速实现,但长期来看,证书管理和更新不够灵活。 随着需求的发展,改为由外部反向代理(如 Nginx)统一处理 HTTPS,加密与证书管理集中在代理层面,容器只需使用 HTTP。这样不仅减少了内部配置复杂度,也方便后续维护。 ⚙️ 优化前配置示例 services: onlyoffice: image: onlyoffice/documentserver container_name: onlyoffice restart: always ports: – “8080:80” – “8443:443” volumes: – /path/to/logs:/var/log/onlyoffice – /path/to/data:/var/www/onlyoffice/Data – /path/to/cache:/var/lib/onlyoffice/documentserver/App_Data/cache/files – /path/to/public:/var/www/onlyoffice/documentserver-example/public/files – /path/to/fonts:/usr/share/fonts 在该配置中,容器内已经开启 HTTPS(8443),同时还挂载了示例文件和自定义字体目录,配置较为繁琐。 ✅ 优化后的配置 为了精简容器内部配置,只保留 HTTP(示例端口 8080),并将证书管理交由反向代理处理,配置文件进行了调整: …

Nextcloud ONLYOFFICE integration app

原文:https://api.onlyoffice.com/editors/nextcloud This app enables users to edit office documents from Nextcloud using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx. The above mentioned formats are also available for viewing together with pdf. The edited files of the corresponding type can be converted into …

Installing Document Server for Docker on a local server

原文:https://helpcenter.onlyoffice.com/server/docker/document/docker-installation.aspx Introduction Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time. Functionality Document Editor Spreadsheet Editor Presentation Editor Documents application for iOS and Android Collaborative editing Hieroglyph …

Error while downloading the document file to be converted

Onlyoffice与Nextcloud集成,在线编缉文件时报错,修改Nextcloud设置: https://help.nextcloud.com/t/error-while-downloading-the-document-file-to-be-converted/70064/5 Nexcloud: config/config.php -> ‘onlyoffice’ => array ( ‘verify_peer_off’ => true, ‘jwt_header’ => “AuthorizationJwt” ) 添加下面的内容即可,注意位置: ‘onlyoffice’ => array ( ‘verify_peer_off’ =>TRUE,

为Onlyoffice添加LetsEncrypt证书

原文:https://stackoverflow.com/questions/50766990/how-to-properly-set-up-https-for-onlyoffice 按照官网建议,生成的证书保存情况如下: /app/onlyoffice/DocumentServer/data/certs# ls dhparam.pem onlyoffice.crt onlyoffice.csr onlyoffice.key 使用LetsEncrypt证书 问题: Also, when copying the created certificates from /etc/letsencrypt/live/[domain] to /app/onlyoffice/DocumentServer/data/certs/, which file between cert.pem, chain.pem, and fullchain.pem becomes onlyoffice.crt? 回答: 1) cert.pem is onlyoffice’s onlyoffice.crt – This is your SSL certificate. 2) privkey.pem is onlyoffice.key – This is your Private Key. 3) You can usually ignore the …