欢迎光临
感受代码之美

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

环境信息

  • 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.
      - [email protected] # Specifies Seafile admin user, default is '[email protected]'.
      - 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替换为你的密码,将[email protected]替换为你自己的邮箱。

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

docker-compose up -d

静待片刻,进行访问。

转载请注明来源:四个空格 » Centos 7基于docker部署seafile个人网盘并启用https(Letsencrypt证书)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址