Webux Lab

By Studio Webux

Seaweedfs and Docker Compose

TG
Tommy Gingras Studio Webux 2023-07-03

A simple Docker Compose to use seaweedfs

I’m using this Solution to transfer files from a Windows (VM) to a MacOS and a Raspberry PI. I draw and prepare files for the CNC and all components are accessible via network only.


The docker compose

# Source: https://github.com/seaweedfs/seaweedfs/blob/master/docker/seaweedfs-compose.yml

version: "3.9"

services:
  master:
    image: chrislusf/seaweedfs
    restart: always
    ports:
      - 9333:9333
      - 19333:19333
      - 9324:9324
    command: "-v=1 master -volumeSizeLimitMB=8192 -resumeState=false -ip=master -port=9333 -peers=master:9333 -mdir=/data -metricsPort=9324"

  volume:
    image: chrislusf/seaweedfs
    restart: always
    ports:
      - 8080:8080
      - 18080:18080
      - 9325:9325
    command: 'volume -dataCenter=dc1 -max=1000 -rack=v1 -mserver="master:9333" -port=8080 -ip=volume -publicUrl=localhost:8080 -preStopSeconds=1 -metricsPort=9325'
    depends_on:
      - master
    volumes:
      - /YOUR_STORAGE/:/data

  filer:
    image: chrislusf/seaweedfs
    restart: always
    ports:
      - 8888:8888
      - 18888:18888
      - 8111:8111
      - 9330:9326
    command: 'filer -defaultReplicaPlacement=000 -iam -master="master:9333" -metricsPort=9326'
    depends_on:
      - master
      - volume

  s3:
    image: chrislusf/seaweedfs
    restart: always
    ports:
      - 8333:8333
      - 9331:9327
    command: 's3 -filer="filer:8888" -ip.bind=0.0.0.0 -metricsPort=9327 -allowEmptyFolder=true -allowDeleteBucketNotEmpty=false'
    depends_on:
      - master
      - volume
      - filer

  webdav:
    image: chrislusf/seaweedfs
    restart: always
    ports:
      - 7333:7333
    command: 'webdav -filer="filer:8888"'
    depends_on:
      - master
      - volume
      - filer

I removed all security components, because it is only local and there is nothing to protect.

The replica placement setting is set to 000 because I didn’t setup the replicas nor the cluster.

Don’t forget to replace the volume to your location : /YOUR_STORAGE/

Example to use this solution

Using the CLI

aws s3 mb s3://YOUR_BUCKET_NAME/ --endpoint-url http://REPLACE_WITH_SERVER_DNS_OR_IP:8333 --no-sign-request
aws s3 cp ./file_to_copy.ext s3://YOUR_BUCKET_NAME/path/to/ --endpoint-url http://REPLACE_WITH_SERVER_DNS_OR_IP:8333 --no-sign-request

Using the Web UI (Filer)

You can access the web UI at http://REPLACE_WITH_SERVER_DNS_OR_IP:8888 and the rest is pretty intuitive… I do recommend to create the bucket using the command line above., then you can use the UI for the usual Upload and Download.

Using Webdav

Didn’t test that one a lot, but was working great to download the files.

you can connect to server like this : Finder > Go > Connect to Serverhttp://REPLACE_WITH_SERVER_DNS_OR_IP:7333


That’s pretty much it … It is very simple to use and the featureset I need is covered. I also started to implement all the logic to use it with my custom NodeJS backend. but this one is not related to this article at all. If you are interested : https://github.com/webuxlab/webuxjs


Search