docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。

  1. 添加源
 yum install epel-release -y
  1. 关闭防火墙,selinux。
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
cat /etc/selinux/config
  1. 安装docker和docker-compose
yum install docker docker-compose -y
  1. 启动docker添加自起
systemctl start docker
systemctl enable docker
  1. 编写docker-yaml
version: '3'
services:
  mysql-db:
    container_name: fno_mysql
    image: mysql
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: 123456
    volumes:
      - /usr/local/mysql/conf:/etc/mysql/conf.d
      - /usr/local/mysql/logs:/logs
      - /usr/local/mysql/data:/var/lib/mysql

  app:
    container_name: nextcloud
    image: nextcloud
    restart: always
    ports:
      - "8080:80"
    volumes:
      - /root/nextcloud/html:/var/www/html
      - /root/nextcloud/apps:/var/www/html/custom_apps
      - /root/nextcloud/config:/var/www/html/config
      - /root/nextcloud/nextcloud/data:/var/www/html/data
      - /root/nextcloud/themes:/var/www/html/themes

  app22:
    container_name: onlyoffice
    image: onlyoffice/documentserver
    restart: always
    ports:
     - "6060:80"
    volumes:
     - /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice
     - /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data
     - /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice
     - /app/onlyoffice/DocumentServer/db:/var/lib/postgresql

  1. 启动,授权mysql
docker-compose -f docker-compose.yml up
docker exec -it mysql_id  bash
mysql -u root -p
GRANT ALL PRIVILEGES on *.* to root@'%' WITH GRANT OPTION;
ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
  1. 查看并访问
docker ps 

docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第1张图片
填写创建的用户密码,和mysql数据库的信息。
docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第2张图片

下载插件很慢,有2种方式:
docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第3张图片
1.配置代理

vim /root/nextcloud/config/config.sample.php

docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第4张图片

2.离线安装
链接:https://apps.nextcloud.com/apps/onlyoffice/releases?platform=22#22
下载之后解压到:

/root/nextcloud/apps

docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第5张图片

  1. 点击应用,并启动应用:

docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第6张图片

  1. 配置onlyoffice:
vi config/config.php  #最后一行添加,否则不能连接成功。
'allow_local_remote_servers' => true,

docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第7张图片

docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第8张图片
docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第9张图片
docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第10张图片
docker-compose 搭建 nextcloud + onlyoffice 实现在线编辑,云存储等多项功能。_第11张图片

你可能感兴趣的:(k8s,docker,linux,centos)