总的来说需要两个文件,如下:
1、compose.yml
需要注意:network_mode 模式、ip为宿主机ip
version: '3.3'
services:
master:
network_mode: "host"
image: chrislusf/seaweedfs # use a remote image
command: "master -ip=172.0.16.143 -ip.bind=172.0.16.143 -metricsPort=9324"
volume:
network_mode: "host"
image: chrislusf/seaweedfs # use a remote image
command: 'volume -mserver="172.0.16.143:9333" -ip.bind=172.0.16.143 -port=8080 -metricsPort=9325'
depends_on:
- master
filer:
network_mode: "host"
image: chrislusf/seaweedfs # use a remote image
command: 'filer -master="172.0.16.143:9333" -ip.bind=172.0.16.143 -metricsPort=9326'
tty: true
stdin_open: true
depends_on:
- master
- volume
s3:
network_mode: "host"
image: chrislusf/seaweedfs # use a remote image
command: 's3 -filer="172.0.16.143:8888" -ip.bind=172.0.16.143 -metricsPort=9327'
depends_on:
- master
- volume
- filer
webdav:
network_mode: "host"
image: chrislusf/seaweedfs # use a remote image
command: 'webdav -filer="172.0.16.143:8888"'
depends_on:
- master
- volume
- filer
# prometheus:
# image: prom/prometheus:v2.21.0
# ports:
# - 9000:9090
# volumes:
# - ./prometheus:/etc/prometheus
# command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
# depends_on:
# - s3
2、install.sh
docker-compose -f seaweedfs-compose.yml -p seaweedfs up