docker搭建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=[email protected] # Specifies Seafile admin user, default is '[email protected]'.
      - 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:

7、启动docker-compose直到完成
docker-compose up -d docker-compose.yml
在这里插入图片描述
8、访问页面
浏览器访问http://服务器IP (端口可在docker-compose.yml修改)
默认账号密码[email protected] asecret (可在docker-compose.yml修改)
docker搭建seafile开源版私有云盘_第1张图片
9、修改服务器上传文件地址
登陆后点击右上角系统管理
docker搭建seafile开源版私有云盘_第2张图片
设置中修改域名为服务器IP
docker搭建seafile开源版私有云盘_第3张图片
之后即可正常使用

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

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

你可能感兴趣的:(docker)