优米格
分享有营养的

Centos 7基于docker部署seafile个人网盘并启用https(Letsencrypt证书)

BraUndress.png

环境信息

  • seafile version 7.0.5;
  • CentOS 7.5 x64;

安装docker-compose

参考这篇文章:CENTOS安装Docker Compose

安装seafile

官网 下载docker-compose.xml,然后进行修改,比如我的修改完如下:

version: '2.0'
services:
  db:
    image: mariadb:10.4
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=Your_Password # 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"  # 启用https必须配置此项.
    volumes:
      - /opt/seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=Your_Password  # 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=admin@4spaces.org # Specifies Seafile admin user, default is 'me@example.com'.
      - SEAFILE_ADMIN_PASSWORD=Your_Password     # Specifies Seafile admin password, default is 'asecret'.
      - SEAFILE_SERVER_LETSENCRYPT=true   # 启用https必须改为true
      - SEAFILE_SERVER_HOSTNAME=drive.4spaces.org # 你的域名,前提是已成功解析
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net:

其中,将drive.4spaces.org替换为你的域名,将Your_Password替换为你的密码,将admin@4spaces.org替换为你自己的邮箱。

然后启动即可(我是使用root用户,使用非root用户一直502,不知为何),命令如下:

docker-compose up -d

静待片刻,进行访问。

赞(0)
未经允许禁止转载:优米格 » Centos 7基于docker部署seafile个人网盘并启用https(Letsencrypt证书)

评论 3

  1. #1

    我使用debian且安装了宝塔面板,在启动这一步提示我80端口已被占用,请问博主怎么解决呀

    sive5年前 (2019-11-29)回复
    • 指定其他端口

      michael5年前 (2019-12-01)回复
  2. #2

    用了root用户还是一直502是怎么回事呢

    5年前 (2020-04-06)回复

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系