Docker安装Nextcloud+collabora office+ocdownloader
Docker安装nextcloud+Redis+Nginx
1.安装docker
2.安装docker-compose
3.创建docker-compose.yml
以下配置文件不包括数据库,数据库需要另外部署。
#~/docker-compose.yml
version: '3' services: nginx: container_name: nginx hostname: nginx image: nginx:1.14 ports: - 80:80 - 443:443 networks: - cloud_net restart: always volumes: - /docker/nextcloud:/usr/share/nginx/html - /docker/nginx/nginx.conf:/etc/nginx/nginx.conf - /docker/nginx/conf:/etc/nginx/conf.d - /docker/certs:/etc/certs - /docker/nginx/log:/var/log/nginx nextcloud_web: image: nextcloud:apache container_name: nextcloud_web hostname: nextcloud_web depends_on: - redis environment: - UPLOAD_MAX_SIZE=10G - APC_SHM_SIZE=128M - OPCACHE_MEM_SIZE=128 - CRON_PERIOD=15m - TZ=Aisa/Shanghai - DOMAIN=hostname - DB_TYPE=mariadb - DB_NAME=nextcloud - DB_USER=root - DB_PASSWORD=root - DB_HOST=IP:3306 ports: - 9000:80/tcp networks: - cloud_net volumes: - /docker/nextcloud:/var/www/html - /docker/aria2/data:/data - /docker/aria2/user-files:/user-files restart: always mariadb: image: mariadb:latest container_name: mariadb environment: MYSQL_ROOT_PASSWORD: root networks: - cloud_net volumes: - /data/mariadb/data:/var/lib/mysql restart: always ports: - 3306:3306 redis: image: redis:alpine container_name: redis hostname: redis restart: always networks: - cloud_net expose: - 6379 restart: always privileged: true #onlyoffice: # image: onlyoffice/documentserver # container_name: onlyoffice # hostname: onlyoffice # privileged: true # environment: # - REDIS_SERVER_HOST=redis # - REDIS_SERVER_PORT=6379 # volumes: # - /docker/onlyoffice/data:/var/www/onlyoffice/Data # - /docker/onlyoffice/logs:/var/log/onlyoffice # restart: always # ports: # - 9001:80/tcp # - 9002:443 # networks: # - cloud_net aria2: image: wahyd4/aria2-ui:latest ports: - "8000:80" - "6800:6800" volumes: - /docker/aria2/app/conf/aria2.conf:/root/conf/aria2.conf - /docker/aria2/app/conf/aria2.session:/root/conf/aria2.session - /docker/aria2/data:/data environment: - DOMAIN=:80 # - SSL=true # - RPC_SECRET=Hello # - ARIA2_USER=111111 # - ARIA2_PWD=111111 # - ENABLE_AUTH=true links: - nextcloud_web:file-manager restart: always networks: - cloud_net networks: cloud_net:
4.拉取用到的镜像
5.先运行Nginx镜像
6.创建需要挂载的目录
7.将当前运行的nginx配置复制到创建的目录中
nginx.conf、conf.d/default.conf
8.停止当前的nginx容器
9.删除当前的nginx容器
10.进入docker-compose.yml同级目录,执行
$ docker-compose up -d
11.查看所有容器是否启动
$ docker ps
12.配置redis到nextcloud配置文件
# vim /docker/nextcloud/config/config.php
在文件尾部添加,保存退出
'memcache.local' => '\OC\Memcache\Redis', 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => 'redis', 'port' => 6379, ),
部署Collabora Office(http)
参考:https://www.jianshu.com/p/4082f998a05b
安装介绍:
本机IP:192.168.1.110,虚拟机地址IP:192.168.33.145
1、安装collabora镜像
docker pull collabora/code
2、运行collabora镜像
docker run -t -d -p 0.0.0.0:9980:9980 -e 'domain=192\\.168\\.1\\.110|192\\.168\\.33\\.145' -e "username=admin" -e "password=123456" --restart always --cap-add MKNOD collabora/code
说明:
镜像端口9980映射到宿主主机9980
添加两台信任主机192.168.1.110、192.168.33.145
为collabora创建用户admin,密码123456
注意:
后台运行,需耐心等待,可通过cpu利用率观察
3、collabora登录测试(https)
https://192.168.33.145:9980/loleaflet/dist/admin/adminSettings.html,显示输入用户名、密码
4、修改loolwsd.xml
查看collabora容器id:docker ps
进入collabora容器:docker exec -it <容器id> /bin/bash
编辑文件/etc/loolwsd/loolwsd.xml中ssl的值为false,如下
<ssl desc="SSL settings">
<enable type="bool" default="true">false</enable>
重启collabora容器:docker restart <容器id>
5、collabora登录测试(http)
http://192.168.33.145:9980/loleaflet/dist/admin/adminSettings.html,显示输入用户名、密码
6、nextcloud连接collabora
启动collabora插件,设置中输入collabora地址http://192.168.33.145:9980
说明:nextcloud登录方式本身是http
部署Airas2+ocDownloader
注意点:*建议相关端口全部开一遍
1.商店不能打开,报错“无法找到当前版本应用”
解决:防火墙开启9000端口,并重启nextcloud容器
[root@localhost ~]# firewall-cmd --zone=public --add-port=9000/tcp --permanent success [root@localhost ~]# docker restart c775ab55f8f3 c775ab55f8f3
2.开启Collabora Online,添加服务地址后,查日志报错“No route to .host .port.”
解决:防火墙开启9980端口,并重启Collabora容器
[root@localhost ~]# firewall-cmd --zone=public --add-port=9980/tcp --permanent success [root@localhost ~]# docker restart fdsa5f8f3
fdsa5f8f3
3.Nextcloud连接本机mariadb,报错“No route to .host.port...”
解决:防火墙开启3306端口,并重启Mairadb容器
[root@localhost ~]# firewall-cmd --zone=public --add-port=3306/tcp --permanent success [root@localhost ~]# docker restart lsodjskd2399ds lsodjskd2399ds