Skip to content

nextcloud

功能丰富的开源网盘系统, 社区活跃, 服务端主要用 PHP 实现

yml
networks:
  nextcloud-net:

services:
  db:
    image: mysql:8
    container_name: nextcloud_mysql8
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    ports:
      - '3306:3306'
    networks:
      - nextcloud-net
    volumes:
      - ./mysql_data:/var/lib/mysql
      - ./mysql_conf:/etc/mysql # 如果不手动修改配置, 请注释这行, 否则会报错
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: root1314
      MYSQL_PASSWORD: nextcloud
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud

  app:
    image: nextcloud:stable
    container_name: nextcloud_app
    restart: always
    depends_on:
      - db
    ports:
      - 8080:80
    networks:
      - nextcloud-net
    volumes:
      - ./nextcloud:/var/www/html
    environment:
      MYSQL_PASSWORD: nextcloud
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_HOST: db

seafile

适合备份同步/协作编辑文件, 可看作开源版的坚果云

yaml
networks:
  seafile-net:

services:
  db:
    image: mariadb:10.11
    restart: always
    container_name: seafile-mysql
    hostname: database_server
    environment:
      MYSQL_ROOT_PASSWORD: root-password # mysql 服务 root 用户密码
      MYSQL_LOG_CONSOLE: true
    volumes:
      - ./seafile-mysql:/var/lib/mysql # mysql 数据
    networks:
      - seafile-net

  memcached:
    image: memcached:1.6 # 缓存服务
    restart: always
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net

  seafile:
    image: seafileltd/seafile-mc:11.0.1 # 注意版本
    restart: always
    container_name: seafile
    volumes:
      - ./seafile-data:/shared
    ports:
      - '80:80'
      #- "443:443"  # 是否使用 https 协议
    environment:
      DB_HOST: database_server
      DB_ROOT_PASSWD: root-password
      TIME_ZONE: Asia/Shanghai
      SEAFILE_ADMIN_EMAIL: your_email@example.com # 管理员账号邮箱
      SEAFILE_ADMIN_PASSWORD: your_admin_password # 管理员账号密码
      SEAFILE_SERVER_LETSENCRYPT: false
      SEAFILE_SERVER_HOSTNAME: seafile.example.com # 你的域名(csrf)
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

cloudreve

速度非常快, 开源版本的百度网盘

准备工作

需要创建一些目录和文件映射容器内的配置文件和目录

sh
# 创建 docker 项目工作目录
mkdir cloudreve-driver
cd cloudreve-driver

# 创建 docker-compose.yaml 配置文件
touch docker-compose.yaml

# 创建 cloudreve 数据存放目录和一些配置文件
mkdir data && \
mkdir cloudreve && \
mkdir cloudreve/{uploads,avatar} && \
touch cloudreve/conf.ini && \
touch cloudreve/cloudreve.db && \

docker-compose.yaml

docker-compose.yaml 文件内容

yaml
services:
  cloudreve:
    container_name: cloudreve
    image: cloudreve/cloudreve:latest
    restart: unless-stopped
    ports:
      # 如果部署在 阿里云/腾讯云 需要在安全组中开放端口
      - '12000:5212'
    volumes:
      - temp_data:/data
      - ./cloudreve/uploads:/cloudreve/uploads
      - ./cloudreve/avatar:/cloudreve/avatar
      - ./cloudreve/conf.ini:/cloudreve/conf.ini
      - ./cloudreve/cloudreve.db:/cloudreve/cloudreve.db
    depends_on:
      - aria2

  aria2:
    container_name: aria2
    image: p3terx/aria2-pro
    restart: unless-stopped
    environment:
      # 注意修改这个密码
      RPC_SECRET: your_password
      RPC_PORT: 6800
    volumes:
      - ./aria2/config:/config
      - temp_data:/data

volumes:
  temp_data:
    driver: local
    driver_opts:
      type: none
      device: $PWD/data
      o: bind

Released under the MIT License.