hlcX's Blog
my note!
Toggle navigation
hlcX's Blog
2.学习
4.群晖
5.CentOS7
6.rasperryPI
linux-mint
关于
归档
标签
对官网的“用 Docker 部署 Seafile 专业版”偿试及踩坑过程
onlyoffice
seafile
docker-comp
docker-compose.yml
docker-compose
2022-12-30 22:34:01
30
0
0
hlcx
onlyoffice
seafile
docker-comp
docker-compose.yml
docker-compose
官网原文1:[Docker部署Seafile专业版](https://cloud.seafile.com/published/seafile-manual-cn/docker/pro-edition/%E7%94%A8Docker%E9%83%A8%E7%BD%B2Seafile.md) 官网原文2:[将 OnlyOffice 加入到 docker-compose.yml](https://cloud.seafile.com/published/seafile-manual-cn/docker/pro-edition/%E7%94%A8Docker%E9%83%A8%E7%BD%B2OnlyOffice.md) > 以下都是基于http的,最终用群晖的反代功能转https # 一、通过docker-compose启动相关容器 ## 1.1、我的docker-compose.yml ``` version: '2.0' services: db: image: mariadb:10.5 container_name: seafile-mysql environment: - MYSQL_ROOT_PASSWORD=sl2w71201 # Requested, set the root's password of MySQL service. - MYSQL_LOG_CONSOLE=true volumes: - /volume2/docker/seafile/seafile-mysql/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store. networks: - seafile-net memcached: image: memcached:1.6 container_name: seafile-memcached entrypoint: memcached -m 256 networks: - seafile-net elasticsearch: image: elasticsearch:7.16.2 container_name: seafile-elasticsearch environment: - discovery.type=single-node - bootstrap.memory_lock=true - xpack.security.enabled=false - "ES_JAVA_OPTS=-Xms1g -Xmx1g" volumes: - /volume2/docker/seafile/seafile-elasticsearch/data:/usr/share/elasticsearch/data # Requested, specifies the path to Elasticsearch data persistent store. networks: - seafile-net oods: image: onlyoffice/documentserver:latest container_name: seafile-oods volumes: - /volume2/docker/seafile/seafile-oods/DocumentServer/logs:/var/log/onlyoffice - /volume2/docker/seafile/seafile-oods/DocumentServer/data:/var/www/onlyoffice/Data - /volume2/docker/seafile/seafile-oods/DocumentServer/lib:/var/lib/onlyoffice #- /volume2/docker/seafile/seafile-oods/DocumentServer/local.json:/etc/onlyoffice/documentserver/local.json #- /volume2/docker/seafile/seafile-oods/DocumentServer/production-linux.json:/etc/onlyoffice/documentserver/production-linux.json networks: - seafile-net environment: - JWT_ENABLED=true - JWT_SECRET=sl2w71201 seafile: image: docker.seafile.top/seafileltd/seafile-pro-mc:latest container_name: seafile ports: - "8885:80" # - "25443:443" # If https is enabled, cancel the comment. volumes: - /volume2/docker/seafile/seafile-data:/shared # Requested, specifies the path to Seafile data persistent store. environment: - DB_HOST=db - DB_ROOT_PASSWD=sl2w71201 # Requested, the value shuold be root's password of MySQL service. # - TIME_ZONE=Asia/Shanghai # Optional, default is UTC. Should be uncomment and set to your local time zone. - SEAFILE_ADMIN_EMAIL=admin@13ua.com # Specifies Seafile admin user, default is 'me@example.com' - SEAFILE_ADMIN_PASSWORD=sl2w71201 # Specifies Seafile admin password, default is 'asecret' - SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not - SEAFILE_SERVER_HOSTNAME=13ua.com # Specifies your host name if https is enabled depends_on: - db - memcached - elasticsearch networks: - seafile-net networks: seafile-net: ``` ## 1.2、启动和关闭命令`docker-compose up -d` - 启动成功 ![title](https://13ua.com:44490/api/file/getImage?fileId=63aef2873c9b990014000062) - 关闭成功 ![title](https://13ua.com:44490/api/file/getImage?fileId=63aef3103c9b990014000063) ## 二、针对onlyoffice的一些可能踩坑的点 ### 2.1、修改seafile的conf中的/opt/seafile/conf/seahub_settings.py,添加以下内容 ``` # OnlyOffice ENABLE_ONLYOFFICE = True VERIFY_ONLYOFFICE_CERTIFICATE = True ONLYOFFICE_APIJS_URL = 'https://13ua.com:8886/onlyofficeds/web-apps/apps/api/documents/api.js' ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt','fodt', 'odp', 'fodp', 'ods', 'fods') ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx') ONLYOFFICE_JWT_SECRET = 'sl2w71201' ``` - 注意:https://13ua.com:8886/onlyofficeds/web-apps/apps/api/documents/api.js 这个端口号8886是seafile的端口 ### 2.2、修改seafile中的/shared/nginx/conf/seafile.nginx.conf,添加以下内容 ``` # Required for only office document server map $http_x_forwarded_proto $the_scheme { default $http_x_forwarded_proto; "" $scheme; } map $http_x_forwarded_host $the_host { default $http_x_forwarded_host; "" $host; } map $http_upgrade $proxy_connection { default upgrade; "" close; } server { listen 80 ; ... ... ... location /onlyofficeds/ { proxy_pass http://oods/; proxy_http_version 1.1; client_max_body_size 100M; proxy_read_timeout 3600s; proxy_connect_timeout 3600s; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $proxy_connection; proxy_set_header X-Forwarded-Host $the_host:8886/onlyofficeds; proxy_set_header X-Forwarded-Proto $the_scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ``` - 注意:proxy_set_header X-Forwarded-Host $the_host:8886/onlyofficeds; 中的8886端口别漏掉了啊。
上一篇:
群晖NAS同步阿里云盘
下一篇:
在Surface上安装Manjaro系统
0
赞
30 人读过
新浪微博
微信
腾讯微博
QQ空间
人人网
提交评论
立即登录
, 发表评论.
没有帐号?
立即注册
0
条评论
More...
文档导航
没有帐号? 立即注册