Docker部署SeaFile

本文详细指导如何使用docker-compose在Docker中部署SeaFile,包括安装docker-compose、编写docker-compose文件、设置环境变量、数据持久化以及启动和访问服务的过程。
摘要由CSDN通过智能技术生成

Docker部署SeaFile

1、安装docker-compose

见主页docker安装笔记

2、编写docker-compose文件

MYSQL_ROOT_PASSWORD:数据库密码

DB_ROOT_PASSWD:与上面写的密码保持一致

SEAFILE_ADMIN_EMAIL:定义管理员账号

SEAFILE_ADMIN_PASSWORD:定义管理员密码

SEAFILE_SERVER_HOSTNAME:配置该服务的域名,没有域名填写IP

version: '2.0'
services:
  db:
    image: mariadb:10.5
    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.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:
3、安装SeaFile
docker-compose up -d   #执行安装

出现如下提示即为安装成功

Creating seafile-mysql     ... done
Creating seafile-memcached ... done
Creating seafile           ... done
4、访问服务

服务的端口是80,直接访问服务器的IP即可,注意本地虚拟机注意防火墙,服务器记得放行安全组

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你好!要使用Docker部署Seafile,你可以按照以下步骤进行操作: 1. 首先,确保你已经安装了DockerDocker Compose。如果你还没有安装,可以在官方网站上找到相关的安装指南。 2. 创建一个新的目录来存储Seafile的配置和数据文件。你可以运行以下命令来创建目录: ``` mkdir seafile-data ``` 3. 在新创建的目录中,创建一个名为 `docker-compose.yml` 的文件,并将以下内容粘贴到文件中: ```yaml version: '3' services: seafile: image: seafileltd/seafile-mc:latest restart: always ports: - "80:80" - "443:443" volumes: - ./seafile-data:/shared ``` 这将使用最新版本的Seafile镜像,并将主机的80端口映射到容器的80端口,以及443端口映射到容器的443端口。 4. 保存并关闭 `docker-compose.yml` 文件。 5. 在终端中,切换到包含 `docker-compose.yml` 文件的目录,并运行以下命令来启动Seafile容器: ``` docker-compose up -d ``` 这将从Docker Hub下载Seafile镜像并启动容器。 `-d` 标志表示在后台运行容器。 6. 等待一段时间,直到容器启动并完成设置。你可以运行以下命令来查看容器的状态: ``` docker-compose ps ``` 如果一切正常,你应该看到Seafile容器正在运行。 7. 现在,你可以通过浏览器访问 `http://localhost` 来使用Seafile。在第一次访问时,你需要设置管理员账号和密码。 这些就是使用Docker部署Seafile的基本步骤。你可以根据需要进行进一步的配置和自定义。希望对你有所帮助!如果有任何问题,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值