赞
踩
onlyoffice镜像获取 需要的镜像
onlyoffice/communityserver
onlyoffice/documentserver
onlyoffice/controlpanel
创建挂载文件夹
mkdir -p /app
mkdir -p /app/onlyoffice
给communityserver创建文件夹
mkdir -p /app/onlyoffice/CommunityServer
mkdir -p /app/onlyoffice/CommunityServer/data
mkdir -p /app/onlyoffice/CommunityServer/logs
mkdir -p /app/onlyoffice/CommunityServer/letsencrypt
给documentserver创建文件夹
mkdir -p /app/onlyoffice/DocumentServer
mkdir -p /app/onlyoffice/DocumentServer/data
mkdir -p /app/onlyoffice/DocumentServer/fonts
mkdir -p /app/onlyoffice/DocumentServer/forgotten
给controlpanel创建文件夹
mkdir -p /app/onlyoffice/ControlPanel
mkdir -p /app/onlyoffice/ControlPanel/data
mkdir -p /app/onlyoffice/ControlPanel/logs
步骤首先创建网桥
docker network create --driver bridge onlyoffice
运行容器创建命令,首先导入容器
文档服务容器启动
docker load -i doc.tar
sudo docker run --net onlyoffice -i -t -d -p 9001:80 --restart=always --name onlyoffice-document-server -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom -v /app/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten onlyoffice/documentserver
控制服务容器启动
docker load -i con.tar
sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control-panel -v /var/run/docker.sock:/var/run/docker.sock -v /app/onlyoffice/CommunityServer/data:/app/onlyoffice/CommunityServer/data -v /app/onlyoffice/ControlPanel/data:/var/www/onlyoffice/Data -v /app/onlyoffice/ControlPanel/logs:/var/log/onlyoffice onlyoffice/controlpanel
社区服务容器启动
docker load -i com.tar
docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 9002:80 -p 443:443 -p 5222:5222 --cgroupns=host -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server -e CONTROL_PANEL_PORT_80_TCP=80 -e CONTROL_PANEL_PORT_80_TCP_ADDR=onlyoffice-control-panel -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt -v /sys/fs/cgroup:/sys/fs/cgroup:rw onlyoffice/communityserver
问题 社区服务运行访问延迟非常大。解决方式,安装本地dns服务器
Community Server - Very slow responses - #3 by Constantine - Docs - ONLYOFFICE
1.配置dockers dns服务地址
修改docker服务的daemon.json配置文件// 增加dns参数地址为本地服务器地址
vi /etc/docker/daemon.json
{
"insecure-registries":["10.11.17.105:5000"],
"data-root":"/home/docker/docker",
"dns":["10.11.17.108"]
}
修改完成后运行命令
systemctl daemon-reload
systemctl restart docker
2.本地dns服务器安装 参考文档【centos 离线安装DNS服务器】_centos7怎么离线安装bind-CSDN博客
进入 bind 文件夹 运行 rpm -Uvh *.rpm离线安装bind服务
systemctl start named
systemctl enable named
修改listen-on port 53 { 127.0.0.1; }; 为 listen-on port 53 { any; }; #服务器上的所有IP地址均可提供DNS域名解析服务
修改allow-query { localhost; }; 为 allow-query { any; }; #允许所有人对本服务器发送DNS查询请求
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cachedump.db";
statistics-file "/var/named/data/namedstats.txt";
memstatistics-file "/var/named/data/namedmemstats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
建立配置文件
修改本机dns 配置文件
vim /etc/resolv.conf
nameserver 10.11.17.108
search 10.11.17.108
重启dns服务
systemctl restart named
至此问题解决
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。