docker安装说明: https://blog.csdn.net/song_java/article/details/88061162
docker镜像地址: https://store.docker.com/community/images/season/fastdfs
宿主机IP地址: 192.168.174.129
使用docker-compose运行fastdfs
version: '2'
services:
tracker:
image: season/fastdfs:1.2
restart: always
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./tracker_data:/fastdfs/tracker/data"
network_mode: "host"
command: "tracker"
storage:
image: season/fastdfs:1.2
restart: always
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./storage_base_path:/fastdfs/storage/data"
- "./store_path0:/fastdfs/store_path"
environment:
TRACKER_SERVER: "192.168.174.129:22122"
network_mode: "host"
command: "storage"
nginx:
image: season/fastdfs:1.2
restart: always
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./nginx.conf:/etc/nginx/conf/nginx.conf"
- "./store_path0:/fastdfs/store_path"
environment:
TRACKER_SERVER: "192.168.174.129:22122"
network_mode: "host"
command: "nginx"
根据docker-compose.yml我们看到主要有3个模块: tracker storage nginx
tracker
挂载 /fastdfs/tracker/data ,这个目录对应的是 tracker.conf中的 base_path