1. 创建目录结构
需要创建 data 目录作为离线下载临时中转目录
mkdir -vp cloudreve/{uploads,avatar} \
&& touch cloudreve/conf.ini \
&& touch cloudreve/cloudreve.db \
&& mkdir -p aria2/config \
&& mkdir -p data/aria2 \
&& chmod -R 777 data/aria2
├── aria2
│ └── config
├── cloudreve
│ ├── avatar
│ ├── uploads
│ ├── config.ini
│ └── cloudreve.db
└── docker-compose.yml
2. 运行
- 创建docker-compose文件,修改文件中的 RPC_SECRET
cd /root/data/cloudreve && nano docker-compose.yml
version: "3.8"
services:
cloudreve:
container_name: cloudreve
image: cloudreve/cloudreve:latest
restart: unless-stopped
ports:
- "5212:5212"
volumes:
- temp_data:/data
- ./cloudreve/uploads:/cloudreve/uploads
- ./cloudreve/conf.ini:/cloudreve/conf.ini
- ./cloudreve/cloudreve.db:/cloudreve/cloudreve.db
- ./cloudreve/avatar:/cloudreve/avatar
depends_on:
- aria2
aria2:
container_name: aria2
image: p3terx/aria2-pro
restart: unless-stopped
environment:
- RPC_SECRET=your_aria_rpc_token
- RPC_PORT=6800
volumes:
- ./aria2/config:/config
- temp_data:/data
volumes:
temp_data:
driver: local
driver_opts:
type: none
device: $PWD/data
o: bind
3. 运行镜像
后台运行模式,可以从 docker/docker-compose 的日志中获取默认管理员账户用户名和密码
docker-compose up -d
或者,直接运行,log 将会直接输出在当前控制台中,请注意退出之后保持当前容器运行
docker-compose up
4. 其他
- 查询初始登录账号密码
docker-compose logs cloudreve
- aria配置
[不可修改] RPC 服务器地址 => http://aria2:6800
[可修改, 需保持和 docker-compose.yml 文件一致] RPC 授权令牌 => my_token
[不可修改] Aria2 用作临时下载目录的 节点上的绝对路径 => /data
- 更新
关闭当前运行的容器,此步骤不会删除挂载的配置文件以及相关目录
docker-compose down
如果此前已经拉取 docker 镜像,使用以下命令获取最新镜像
docker pull cloudreve/cloudreve
重复运行步骤即可
aria2
aria2:
container_name: aria2
image: p3terx/aria2-pro
restart: unless-stopped
environment:
- RPC_SECRET=token # aria rpc token, customize your own
- RPC_PORT=6800
- LISTEN_PORT=6888
- DISK_CACHE=64M
- IPV6_MODE=false
- UPDATE_TRACKERS=true
- CUSTOM_TRACKER_URL=
- TZ=Asia/Shanghai
volumes:
- ./aria2/config:/config
- temp_data:/data
ports:
- 6888:6888
- 6888:6888/udp
- 6800:6800
logging:
driver: json-file
options:
max-size: 1m
networks:
- default
Aria2一键安装管理脚本
wget -N https://raw.githubusercontent.com/P3TERX/aria2.sh/master/aria2.sh && chmod +x aria2.sh
./aria2.sh