seafile.yml
ARM 版本不支持 elasticsearch 组件,在配置文件中取消了该文件的配置内容。更细致的配置可对比参考 301801-R5S OpenWRT 配置 中云盘的配置部分。
以下的配置文件增加了 fuse 挂载部分,FUSE 功能允许管理员在服务端挂载显示对应用户的文件(文件是切分为块文件存储的,正常情况下无法看到具体的文件情况)
version: '3.0' services: db: image: mariadb:10.6 container_name: seafile-mysql environment: - MYSQL_ROOT_PASSWORD=password # Requested, set the root's password of MySQL service. - MYSQL_LOG_CONSOLE=true volumes: - /data1/seafile/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store. networks: - seafile-net memcached: image: memcached:1.6.18 container_name: seafile-memcached entrypoint: memcached -m 256 networks: - seafile-net seafile: image: docker.seafile.top/seafileltd/seafile-pro-mc:11.0-latest container_name: seafile ports: - "8002:80" volumes: - /data1/seafile/data:/shared - /data1/seafile/deps/seafile-controller:/opt/seafile/seafile-pro-server-11.0.16/seafile/bin/seafile-controller - /data1/seafile/deps/seaf-server:/opt/seafile/seafile-pro-server-11.0.16/seafile/bin/seaf-server - /data1/seafile/deps/licenseparse.py:/opt/seafile/seafile-pro-server-11.0.16/seahub/seahub/utils/licenseparse.py - /data1/backup:/mnt/backup # - type: bind # bind: # propagation: shared # source: /data1/backup # target: /shared/seafile-fuse environment: - DB_HOST=db - DB_ROOT_PASSWD=password - TIME_ZONE=Asia/Shanghai - SEAFILE_ADMIN_EMAIL=13609796771@139.com - SEAFILE_ADMIN_PASSWORD=password - SEAFILE_SERVER_LETSENCRYPT=false - SEAFILE_SERVER_HOSTNAME=yunpan.lfang.me depends_on: - db - memcached networks: - seafile-net cap_add: - SYS_ADMIN devices: - "/dev/fuse:/dev/fuse" networks: seafile-net:
fuse 在配置文件中实现直接挂载的功能没有实现(图中注释部分),系统提示“Error response from daemon: path /data1/backup is mounted on /data1 but it is not a shared mount” 的错误一直没有解决。
进入容器挂载
docker exec -it seafile bash /opt/seafile/seafile-server-latest/seaf-fuse.sh start /mnt/backup/ ls -lhp /mnt/backup
其它配置文件参考
services: db: container_name: seafile-database image: mariadb:10.11 restart: unless-stopped environment: - MYSQL_ROOT_PASSWORD=db_dev # Requested, set the root's password of MySQL service. - MYSQL_LOG_CONSOLE=true volumes: - /path/to/database/storage:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store. networks: - seafile-net memcached: container_name: seafile-cache image: memcached:1.6.18 restart: unless-stopped entrypoint: memcached -m 256 networks: - seafile-net seafile: container_name: seafile-backend image: kynn/seafile-rpi:11.0.2-2023.12.1 restart: unless-stopped ports: - "your-external-port:80" # Custom port used if you have a reverse proxy on the same server. Otherwise you can put "80:80" #- "443:443" # If https is enabled, cancel the comment. volumes: # See https://stackoverflow.com/questions/53631567/share-a-fuse-fs-mounted-inside-a-docker-container-through-volumes - type: bind # This is a specific type of volume mount called Bind-Mount bind: # which allows you to submount folders in it, propagation: shared # from the host side, or from the container side. source: /path/to/seafile/storage # The goal is to submount seafile database in it using seaf-fuse target: /shared # The seafile image I made will mount the fuse FS in /shared/fuse/mount-point environment: - DB_HOST=db - DB_ROOT_PASSWD=db_dev # Requested, the value shuold be root's password of MySQL service. - TIME_ZONE=Etc/UTC # Optional, default is UTC. Should be uncomment and set to your local time zone. - SEAFILE_SERVER_HOSTNAME=yourDomain # Specifies your host name if https is enabled. - SEAFILE_ADMIN_EMAIL=yourMail # Specifies Seafile admin user, default is 'me@example.com'. - SEAFILE_ADMIN_PASSWORD=yourOwnSecret # Specifies Seafile admin password, default is 'asecret'. - SEAFILE_SERVER_LETSENCRYPT=false # Whether to use let's encrypt or not networks: - seafile-net depends_on: - db - memcached cap_add: # Needed for Seaf-Fuse inside the container - SYS_ADMIN # For now Docker doesn't allow it any other way devices: # For more information see https://github.com/docker/for-linux/issues/321 - "/dev/fuse:/dev/fuse" networks: seafile-net:
参考
- seafile 官方描述 fuse 的功能 https://manual.seafile.com/11.0/extension/fuse/
- docker 官方针对 volumes 的挂载说明 https://docs.docker.com/reference/compose-file/services/#volumes
- 论坛针对 volumes 的挂载解释 https://stackoverflow.com/questions/53631567/share-a-fuse-fs-mounted-inside-a-docker-container-through-volumes
- 针对 seafile fuse 挂载的其它配置分享 https://github.com/Cherryblue/seafile-docker/tree/master
- homelab 针对 seafile 的配置分享 https://github.com/JarlMorgennebel/homelab
添加评论