# Test Setup for SeaweedFS with 6 disks, a Filer an an S3 API
#
# Use with the following .env file
# root@minio-ssd:~# cat /opt/seaweedfs/.env 
# AWS_ACCESS_KEY_ID="hottentotten"
# AWS_SECRET_ACCESS_KEY="tentententoonstelling"

services:
# Master
  master0:
    image: chrislusf/seaweedfs
    ports:
      - 9333:9333
      - 19333:19333
    command: "-v=1 master -volumeSizeLimitMB 100 -resumeState=false -ip=master0 -ip.bind=0.0.0.0 -port=9333 -mdir=/var/lib/seaweedfs/master"
    volumes:
      - ./data/master0:/var/lib/seaweedfs/master
    restart: unless-stopped

# Volume Server 1
  volume1:
    image: chrislusf/seaweedfs
    command: 'volume -dataCenter=dc1 -rack=r1 -mserver="master0:9333" -port=8081 -preStopSeconds=1 -dir=/var/lib/seaweedfs/volume1'
    volumes:
      - /data/disk1:/var/lib/seaweedfs/volume1
    depends_on:
      - master0
    restart: unless-stopped

# Volume Server 2
  volume2:
    image: chrislusf/seaweedfs
    command: 'volume -dataCenter=dc1 -rack=r1 -mserver="master0:9333" -port=8082 -preStopSeconds=1 -dir=/var/lib/seaweedfs/volume2'
    volumes:
      - /data/disk2:/var/lib/seaweedfs/volume2
    depends_on:
      - master0
    restart: unless-stopped

# Volume Server 3
  volume3:
    image: chrislusf/seaweedfs
    command: 'volume -dataCenter=dc1 -rack=r1 -mserver="master0:9333" -port=8083 -preStopSeconds=1 -dir=/var/lib/seaweedfs/volume3'
    volumes:
      - /data/disk3:/var/lib/seaweedfs/volume3
    depends_on:
      - master0
    restart: unless-stopped

# Volume Server 4
  volume4:
    image: chrislusf/seaweedfs
    command: 'volume -dataCenter=dc1 -rack=r1 -mserver="master0:9333" -port=8084 -preStopSeconds=1 -dir=/var/lib/seaweedfs/volume4'
    volumes:
      - /data/disk4:/var/lib/seaweedfs/volume4
    depends_on:
      - master0
    restart: unless-stopped

# Volume Server 5
  volume5:
    image: chrislusf/seaweedfs
    command: 'volume -dataCenter=dc1 -rack=r1 -mserver="master0:9333" -port=8085 -preStopSeconds=1 -dir=/var/lib/seaweedfs/volume5'
    volumes:
      - /data/disk5:/var/lib/seaweedfs/volume5
    depends_on:
      - master0
    restart: unless-stopped

# Volume Server 6
  volume6:
    image: chrislusf/seaweedfs
    command: 'volume -dataCenter=dc1 -rack=r1 -mserver="master0:9333" -port=8086 -preStopSeconds=1 -dir=/var/lib/seaweedfs/volume6'
    volumes:
      - /data/disk6:/var/lib/seaweedfs/volume6
    depends_on:
      - master0
    restart: unless-stopped

# Filer
  filer:
    image: chrislusf/seaweedfs
    ports:
      - 8888:8888
      - 18888:18888
    command: 'filer -defaultReplicaPlacement=002 -iam -master="master0:9333"'
    volumes:
      - ./data/filer:/data
    depends_on:
      - master0
      - volume1
      - volume2
      - volume3
      - volume4
      - volume5
      - volume6
    restart: unless-stopped

# S3 API
  s3:
    image: chrislusf/seaweedfs
    ports:
      - 8333:8333
    command: 's3 -filer="filer:8888" -ip.bind=0.0.0.0'
    env_file:
      - .env
    depends_on:
      - master0
      - volume1
      - volume2
      - volume3
      - volume4
      - volume5
      - volume6
      - filer
    restart: unless-stopped
