
gronis/seafile基于Ubuntu的Seafile Server Docker容器,源自GitHub仓库,用于快速部署Seafile文件同步与共享服务。该镜像提供自动化配置、版本升级和灵活的数据库支持,适合个人或组织搭建私有云存储系统。
!Docker Stars !Docker Pulls !Docker Build !Layers
garbage_collect: 运行垃圾回收器而非启动服务器autorun: 默认模式,必要时设置服务器、升级数据库后启动服务maintenance: 仅启动容器,可通过docker exec登录进行维护操作/seafile/ |-- ccnet |-- conf |-- seafile-data `-- seahub-data /opt/ `-- haiwen |-- ccnet -> /seafile/ccnet |-- conf -> /seafile/conf |-- logs |-- pids |-- seafile-data -> /seafile/seafile-data |-- seafile-server-5.1.3 |-- seafile-server-latest -> seafile-server-5.1.3 `-- seahub-data -> /seafile/seahub-data
所有重要数据存储在/seafile目录下,建议挂载该目录为卷(如示例配置所示),或分别挂载其子目录。
| 变量名 | 说明 |
|---|---|
SEAFILE_NAME | Seafile实例名称 |
SEAFILE_ADDRESS | Seafile访问URL |
SEAFILE_ADMIN | 管理员电子*** |
SEAFILE_ADMIN_PW | 管理员密码 |
使用MySQL/MariaDB时需配置:
| 变量名 | 说明 |
|---|---|
MYSQL_SERVER | MySQL服务器地址 |
MYSQL_USER | Seafile使用的MySQL用户名 |
MYSQL_USER_PASSWORD | MySQL用户密码 |
MYSQL_PORT(可选) | MySQL端口(默认3306) |
| 变量名 | 说明 | 默认值 |
|---|---|---|
MYSQL_USER_HOST | MySQL用户允许访问的主机 | % |
MYSQL_ROOT_PASSWORD | MySQL root密码(用于自动创建数据库) | - |
| 变量名 | 说明 | 默认值 |
|---|---|---|
MODE | 启动模式:autorun(默认)、run_only、maintenance、setup_mysql、setup_sqlite、update、diagnose、collect_garbage | autorun |
FILE_SERVER_ROOT | 设置seahub配置中的FILE_SERVER_ROOT变量 | - |
SERVICE_URL | 设置seahub配置中的SERVICE_URL变量 | - |
SEAHUB_DB_DIR | 当不挂载/seafile卷而单独挂载子目录时,指定seahub.db存放路径 | - |
docker runbashdocker run -d -e SEAFILE_NAME=Seafile \ -e SEAFILE_ADDRESS=seafile.example.com \ -e SEAFILE_ADMIN=*** \ -e SEAFILE_ADMIN_PW=SuperSecretPassword \ -v /host/os/path:/seafile \ gronis/seafile
bashdocker run -d -e SEAFILE_NAME=Seafile \ -e SEAFILE_ADDRESS=seafile.example.com \ -e SEAFILE_ADMIN=*** \ -e SEAFILE_ADMIN_PW=SuperSecretPassword \ -e MYSQL_SERVER=seafile-db \ -e MYSQL_USER=seafile \ -e MYSQL_USER_PASSWORD=SuperSecretDatabasePassword \ -e MYSQL_ROOT_PASSWORD=EvenMoreSuperSecretDatabasePassword \ -v /host/os/path:/seafile \ gronis/seafile
docker-composeyamlversion: '2' services: seafile: image: gronis/seafile container_name: seafile restart: unless-stopped volumes: - ./seafile-container-data:/seafile:rw ports: - 8000:8000 - 8082:8082 environment: - SEAFILE_NAME=Seafile - SEAFILE_ADDRESS=seafile.example.com - SEAFILE_ADMIN=*** - SEAFILE_ADMIN_PW=SuperSecretPassword
yamlversion: '2' services: seafile: image: gronis/seafile container_name: seafile restart: unless-stopped depends_on: - seafile-db links: - seafile-db volumes: - ./seafile-container-data:/seafile:rw ports: - 8000:8000 - 8082:8082 environment: - SEAFILE_NAME=Seafile - SEAFILE_ADDRESS=seafile.example.com - SEAFILE_ADMIN=*** - SEAFILE_ADMIN_PW=SuperSecretPassword - MYSQL_SERVER=seafile-db - MYSQL_USER=seafile - MYSQL_USER_PASSWORD=SuperSecretDatabasePassword - MYSQL_ROOT_PASSWORD=EvenMoreSuperSecretDatabasePassword seafile-db: image: mariadb:latest container_name: seafile-db restart: unless-stopped volumes: - ./seafile-db-data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=EvenMoreSuperSecretDatabasePassword
建议将容器部署在反向代理后,以下是使用Nginx反向代理和Let's Encrypt实现HTTPS的完整配置(假设域名为seafile.example.com):
yamlversion: '2' services: seafile: image: gronis/seafile container_name: seafile restart: unless-stopped depends_on: - seafile-db links: - seafile-db volumes: - ./seafile-container-data:/seafile:rw environment: - VIRTUAL_HOST=seafile.example.com - VIRTUAL_PORT=8000 - LETSENCRYPT_HOST=seafile.example.com - LETSENCRYPT_EMAIL=*** - SEAFILE_NAME=Seafile - SEAFILE_ADDRESS=seafile.example.com - SEAFILE_ADMIN=*** - SEAFILE_ADMIN_PW=SuperSecretPassword - SERVICE_URL=[***] - FILE_SERVER_ROOT=[***] - MYSQL_SERVER=seafile-db - MYSQL_USER=seafile - MYSQL_USER_PASSWORD=SuperSecretDatabasePassword - MYSQL_ROOT_PASSWORD=EvenMoreSuperSecretDatabasePassword seafile-db: image: mariadb:latest container_name: seafile-db restart: unless-stopped volumes: - ./seafile-db-data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=EvenMoreSuperSecretDatabasePassword nginx: image: nginx:alpine container_name: nginx restart: always ports: - 80:80 - 443:443 volumes: - ./nginx/conf.d:/etc/nginx/conf.d:ro - ./nginx/vhost.d:/etc/nginx/vhost.d:ro - ./nginx/html:/usr/share/nginx/html - ./nginx/certs:/etc/nginx/certs:ro - ./nginx/htpasswd:/etc/nginx/htpasswd:ro nginx-gen: image: jwilder/docker-gen:0.7.3 container_name: nginx-gen restart: always depends_on: - nginx volumes_from: - nginx volumes: - /var/run/docker.sock:/tmp/docker.sock:ro - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro - ./nginx/conf.d:/etc/nginx/conf.d:rw networks: - proxy-tier entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf letsencrypt-nginx-proxy-companion: image: nginxproxy/acme-companion container_name: letsencrypt-nginx-proxy-companion restart: unless-stopped depends_on: - nginx - nginx-gen volumes_from: - nginx volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./nginx/vhost.d:/etc/nginx/vhost.d:rw - ./nginx/certs:/etc/nginx/certs:rw environment: - NGINX_DOCKER_GEN_CONTAINER=nginx-gen
Seafile使用8082端口进行文件同步,需在Nginx中添加以下配置(保存至./nginx/vhost.d/seafile.example.com):
conflocation /seafhttp { rewrite ^/seafhttp(.*)$ $1 break; proxy_pass [***] client_max_body_size 0; proxy_connect_timeout 36000s; proxy_read_timeout 36000s; proxy_send_timeout 36000s; send_timeout 36000s; }
同时在Seafile服务的环境变量中添加:
yamlenvironment: - SERVICE_URL=[***] - FILE_SERVER_ROOT=[***]






manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务