docker-compose搭建seafile开源版私有云盘

1、linux下安装docker-ce
方法自行百度

2、下载docker-compose稳定的版本

curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

3、对下载的版本给予可执行权限
chmod +x /usr/local/bin/docker-compose

4、做软连接,为了让docker-compose可在全局执行
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

5、docker-compose版本检查
docker-compose --version
在这里插入图片描述
6、创建docker-compose.yml文件
vim docker-compose.yml

version: '2.0'
services:
  db:
    image: mariadb:10.1
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=db_dev  # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /opt/seafile-mysql/db:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net
          
  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    ports:
      - "80:80"
#      - "443:443"  # If https is enabled, cancel the comment.
    volumes:
      - /opt/seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=db_dev  # 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=me@example.com # Specifies Seafile admin user, default is 'me@example.com'.
      - SEAFILE_ADMIN_PASSWORD=asecret     # Specifies Seafile admin password, default is 'asecret'.
      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether use letsencrypt to generate cert.
      - SEAFILE_SERVER_HOSTNAME=seafile.example.com # Specifies your host name.
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net:

文件目录映射到本地目录:
/opt/seafile-mysql/db
/opt/seafile-data

7、启动docker-compose直到完成
docker-compose up -d docker-compose.yml
在这里插入图片描述
8、访问页面
浏览器访问http://服务器IP (端口可在docker-compose.yml修改)
默认账号密码me@example.com asecret (可在docker-compose.yml修改)
在这里插入图片描述
9、修改服务器上传文件地址
登陆后点击右上角系统管理
在这里插入图片描述
设置中修改域名为服务器IP
在这里插入图片描述
之后即可正常使用

容器路径会映射在服务器/opt下
在这里插入图片描述
上传的文件会分片存储在如下路径
/opt/seafile-data/seafile/seafile-data/storage

参考官方文档
https://cloud.seafile.com/published/seafile-manual-cn/docker/

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值