1
2
3
4
mkdir -p /opt/clouddrive2
mkdir -p /opt/clouddrive2/cloudmounts # 用于存放云挂载数据
mkdir -p /opt/clouddrive2/config # 用于存放配置文件
mkdir -p /opt/clouddrive2/media # 可选,用于存放媒体文件

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
version: "2.1"
services:
cloudnas:
image: cloudnas/clouddrive2
container_name: clouddrive2
environment:
- TZ=Asia/Shanghai
- CLOUDDRIVE_HOME=/Config
volumes:
- /opt/clouddrive2/cloudmounts:/CloudNAS:shared # 将云挂载目录挂载到容器
- /opt/clouddrive2/config:/Config # 将配置文件目录挂载到容器
- /opt/clouddrive2/media:/media:shared # 可选:将媒体目录挂载到容器
devices:
- /dev/fuse:/dev/fuse # FUSE 支持,允许挂载云存储
restart: unless-stopped
pid: "host"
privileged: true
network_mode: "host" # 使用宿主机网络模式