一、示例域名:
需要开放的端口: 21443,8082,8083
二、硬件:
群晖DS923
三、启用的容器:
seafile,caddy,notification-server,seadoc
四、软件版本:
Seafile Pro Editon 12.0.6
五:域名SSL证书路径:
/volume1/docker/ssl
├── fullchain.cer
└── my.site.cn.key
六、Seafile数据目录结构:
/volume1/docker/seafile-server/
├── notification-data
│ └── logs
├── seadoc-data
├── seafile-caddy
├── seafile-data
├── seafile-elasticsearch
│ └── data
└── seafile-mysql
│ └── db
七、配置文件:
创建目录:
# 创建目录
mkdir -p /volume1/docker/ssl
mkdir -p /volume1/docker/seafile-server/{notification-data/logs,seadoc-data,seafile-caddy,seafile-data,seafile-elasticsearch/data,seafile-mysql/db}
# 设置权限
chmod -R 777 /volume1/docker/seafile-server/seafile-elasticsearch/data
chmod -R 755 /volume1/docker/ssl
chmod -R 755 /volume1/docker/seafile-server/{notification-data,seadoc-data,seafile-caddy,seafile-data,seafile-mysql}
.env,内容修改如下:
COMPOSE_FILE='seafile-server.yml,caddy.yml,notification-server.yml,seadoc.yml'
COMPOSE_PATH_SEPARATOR=','
# Seafile及基本服务
## 镜像
...
## caddy镜像,官方默认镜像没有集成curl,会导致健康检查失败
## 换用lucaslorentz/caddy-docker-proxy:2.9-alpine可以解决
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9-alpine
## 持久存储
SEAFILE_VOLUME=/volume1/docker/seafile-server/seafile-data
SEAFILE_MYSQL_VOLUME=/volume1/docker/seafile-server/seafile-mysql/db
SEAFILE_ELASTICSEARCH_VOLUME=/volume1/docker/seafile-server/seafile-elasticsearch/data
SEAFILE_CADDY_VOLUME=/volume1/docker/seafile-server/seafile-caddy
...
## 访问方案
SEAFILE_SERVER_HOSTNAME=my.site.cn:21443
SEAFILE_SERVER_PROTOCOL=https
## 自定义SSL证书路径
PHYSICAL_CERT_PATH=/volume1/docker/ssl
### SSL_CERTIFICATE字段值可以是fullchain.cer或者my.site.cn.crt
SSL_CERTIFICATE=fullchain.cer
SSL_CERTIFICATE_KEY=my.site.cn.key
## 启动参数
TIME_ZONE=Asia/Shanghai
...
# SeaDoc服务
ENABLE_SEADOC=true
SEADOC_VOLUME=/volume1/docker/seafile-server/seadoc-data
SEADOC_SERVER_URL=https://my.site.cn:21443/sdoc-server
# 通知服务器
NOTIFICATION_SERVER_VOLUME=/volume1/docker/seafile-server/notification-data
seafile-server.yml,内容修改如下:
services:
...
seafile:
...
labels:
...
caddy.tls: /ssl/${SSL_CERTIFICATE} /ssl/${SSL_CERTIFICATE_KEY}
...
caddy.yml,内容修改如下:
services:
caddy:
image: ${SEAFILE_CADDY_IMAGE:-lucaslorentz/caddy-docker-proxy:2.9-alpine}
...
ports:
# - 80:80
- 21443:21443
...
volumes:
...
- ${PHYSICAL_CERT_PATH:-/ssl}:/ssl
...
seafevents.conf,完成部署之后,可修改下列字段值,仅索引文件名和目录名,修改完之后重启容器:
...
[INDEX FILES]
...
index_office_pdf = false
...
seahub_settings.py,完成部署之后,SERVICE_URL 与 FILE_SERVER_ROOT 应如下所示:
# -*- coding: utf-8 -*-
...
SERVICE_URL = "http://my.site.cn:21443"
...
FILE_SERVER_ROOT = 'https://my.site.cn:21443/seafhttp'
...
seafile.nginx.conf,完成部署之后,开头应如下所示:
# -*- mode: nginx -*-
# Auto generated at 01/08/2025 22:23:30
server {
listen 80;
server_name my.site.cn;
...
执行 sudo docker logs -f seafile,正常日志如下:
*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 19
*** Running /scripts/enterpoint.sh...
2025-01-13 00:02:47 Nginx ready
2025-01-13 00:02:47 This is an idle script (infinite loop) to keep container running.
[2025-01-13 00:02:47] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
[01/13/2025 00:02:47][upgrade]: The container was recreated, start fix the media symlinks
mv: not replacing '/shared/seafile/seahub-data/avatars/default-non-register.jpg'
mv: not replacing '/shared/seafile/seahub-data/avatars/default.png'
mv: not replacing '/shared/seafile/seahub-data/avatars/groups'
[01/13/2025 00:02:47][upgrade]: Done
Starting seafile server, please wait ...
Seafile server started
Done.
Starting seahub at port 8000 ...
Seahub is started
Done.