docker 安装nextcloud+onlyoffice+mysql

  • A+
所属分类:linux技术
摘要

nextcloud安装onlyoffice app点击右上角用户图标–》应用–》office & text–》only office –》点击下载安装并启用


环境

类目 版本 备注
操作系统 centos 7 64位
Docker 最新版
Docker compose 最新版 暂时没有用上可以不安装
nextcloud 最新版
onlyoffice 最新版
mysql 最新版

安装

基础依赖

 yum install epel-release -y 
yum install lynx wget expect iptables net-tools -y 

关闭防火墙

systemctl stop firewalld systemctl disable firewalld 

安装docker相关

yum install git docker docker-compose -y 

配置docker 国内镜像源

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://e674da1e.m.daocloud.io 

启动docker 并设置开机自启

 systemctl start docker.service 
 systemctl enable docker 

拉取mysql、nextcloud、onlyoffice镜像

docker pull mysql docker pull nextcloud docker pull onlyoffice/documentserver 

安装MySQL

docker run -p 3306:3306 --restart=always --name mysql -v /usr/local/mysql/conf:/etc/mysql/conf.d -v /usr/local/mysql/logs:/logs -v /usr/local/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql 

配置MySQL

docker exec -it mysql容器ID /bin/bash root@ID:/# mysql -u root -p mysql> GRANT ALL PRIVILEGES on *.* to root@'%' WITH GRANT OPTION; mysql> ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER; Query OK, 0 rows affected (0.02 sec) mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';  Query OK, 0 rows affected (0.01 sec) mysql>  FLUSH PRIVILEGES; mysql> exit 

安装nextcloud

docker run -p 8080:80 --restart=always -v /root/nextcloud/html:/var/www/html -v /root/nextcloud/apps:/var/www/html/custom_apps -v /root/nextlcoud/config:/var/www/html/config -v /root/nextcloud/nextcloud/data:/var/www/html/data -v /rott/nextcloud/themes:/var/www/html/themes -d nextcloud 

配置nextcloud

  1. 设置用户名、密码
  2. 配置连接mysql 数据库配置信息(数据库【没有时可自动创建】、用户名、密码、IP地址)

安装onlyoffice

docker run -i -t -d -p 6060:80 --restart=always -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver 

配置onlyoffice

  1. nextcloud安装onlyoffice app

    点击右上角用户图标--》应用--》office & text--》only office --》点击下载安装并启用

    ![image-20211011162806124](/Users/freedom/Library/Application Support/typora-user-images/image-20211011162806124.png)

  2. 修改nextcloud config.php设置

添加如下语句,路径/root/nextlcoud/config 'allow_local_remot_servers' => true; 
  1. 配置nextcloud onlyoffice 服务器地址

    点击右上角用户图标--》设置--》onlyoffice--》配置相关信息

    docker  安装nextcloud+onlyoffice+mysql
    原文链接