# MySQL 初始化权限 echo"ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'my-secret-pw'; CREATE USER IF NOT EXISTS 'onlyoffice_user'@'%' IDENTIFIED WITH mysql_native_password BY 'onlyoffice_pass'; CREATE USER IF NOT EXISTS 'mail_admin'@'%' IDENTIFIED WITH mysql_native_password BY 'Isadmin123'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; GRANT ALL PRIVILEGES ON *.* TO 'onlyoffice_user'@'%'; GRANT ALL PRIVILEGES ON *.* TO 'mail_admin'@'%'; FLUSH PRIVILEGES;" > /data/docker/onlyoffice/mysql/initdb/setup.sql
leazhi@ubuntu2310:~$ sudo docker ps -a |egrep mysql c6118e032ee2 mysql:8.0.29 "docker-entrypoint.s…" About a minute ago Up About a minute 3306/tcp, 33060/tcp onlyoffice-mysql-server
部署 DocumentServer 容器
1.**至关重要的一步,决定了你部署完成后是否报 The document security token is not correctly formed. Please contact your Document Server administrator. 的错误。官方文档没有说明,反而在 onlyoffice github 项目 README 有说明**:手动生成 JWT_SECRET:
1
JWT_SECRET=$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12);
leazhi@ubuntu2310:~$ sudo docker ps -a |egrep control a86ac81356e6 onlyoffice/controlpanel "/var/www/onlyoffice…" 41 minutes ago Up 41 minutes 80/tcp, 443/tcp onlyoffice-control-panel
leazhi@ubuntu2310:~$ sudo docker ps -a |egrep community 8d1c504439e4 onlyoffice/communityserver "/app/run-community-…" 27 seconds ago Up 27 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 3306/tcp, 5280/tcp, 9865-9866/tcp, 9871/tcp, 9882/tcp, 0.0.0.0:5222->5222/tcp, :::5222->5222/tcp, 9888/tcp onlyoffice-community-server
扩展说明
项目运行完成后,查看下整个项目所使用到的容器镜像:
1 2 3 4 5 6 7
leazhi@ubuntu2310:/data/docker/onlyoffice$ sudo docker images -a REPOSITORY TAG IMAGE ID CREATED SIZE onlyoffice/documentserver latest a52fca04de77 13 days ago 3.13GB onlyoffice/communityserver latest 6848b5630774 5 months ago 5.12GB onlyoffice/controlpanel latest 26f8e663afac 7 months ago 640MB mysql 8.0.29 33037edcac9b 16 months ago 444MB onlyoffice/mailserver latest 222be3f84e5e 3 years ago 1.86GB
容器部署完成后,就可以使用物理机 IP 在浏览器访问 onlyoffice workplace 项目了,如下:
1.设置访问密码、语言及时区(这个也可以在后期的使用过程中进行设置):
2.点击上面的 确定 按钮后,进入 onlyoffice workplace 主页:
3.访问 onlyoffice web ,创建表格文件:
无法容忍的是:相信很多读者根据官方的说明文档安装完成后,在创建或者浏览除了 MP3 和 MP4 正常外的其他文件时,都会出现 The document security token is not correctly formed. Please contact your Document Server administrator. 的故障,进而无法创建或者浏览文件。可耻的是,在网上搜索解决方法时,基本上都是复制粘贴一些没有一点作用废话,要么就提供一个连自己都没验证过的不知道从哪里搬去的解决思路误导别人。
# 部署 onlyoffice workplace,但是不部署 mail server bash /usr/local/sbin/workspace-install.sh -ims false
最后部署完成后的镜像:
1 2 3 4 5 6 7 8 9 10 11
root@ubuntu2310:/usr/local/sbin# docker images -a REPOSITORY TAG IMAGE ID CREATED SIZE onlyoffice/documentserver 7.5.1.1 a52fca04de77 11 days ago 3.13GB onlyoffice/documentserver latest a52fca04de77 11 days ago 3.13GB onlyoffice/communityserver 12.5.2.1848 6848b5630774 5 months ago 5.12GB onlyoffice/communityserver latest 6848b5630774 5 months ago 5.12GB onlyoffice/controlpanel 3.5.0.516 26f8e663afac 7 months ago 640MB onlyoffice/controlpanel latest 26f8e663afac 7 months ago 640MB mysql 8.0.29 33037edcac9b 16 months ago 444MB onlyoffice/elasticsearch 7.16.3 77bcd079c9e1 16 months ago 646MB onlyoffice/mailserver latest 222be3f84e5e 3 years ago 1.86GB