networks:
  1panel-network:
    external: true
  seaweedfs-network:

services:
  seaweedfs-master:
    image: chrislusf/seaweedfs:3.99
    container_name: ${CONTAINER_NAME}-master
    restart: always
    networks:
      - seaweedfs-network
    ports:
      - ${PANEL_APP_PORT_MASTER_SERVER}:9333
      - ${PANEL_APP_PORT_MASTER_API}:19333
      - ${PANEL_APP_PORT_MASTER_METRICS}:9324
    command: "master -ip=master -ip.bind=0.0.0.0 -metricsPort=9324"
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1}
      - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2}
      - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3}
    environment:
      - TZ=Asia/Shanghai
  seaweedfs-volume:
    image: chrislusf/seaweedfs:3.99
    depends_on:
      - seaweedfs-master
    container_name: ${CONTAINER_NAME}-volume
    restart: always
    networks:
      - seaweedfs-network
    ports:
      - ${PANEL_APP_PORT_VOLUME_SERVER}:8080
      - ${PANEL_APP_PORT_VOLUME_API}:18080
      - ${PANEL_APP_PORT_VOLUME_METRICS}:9325
    command: 'volume -mserver="seaweedfs-master:9333" -ip.bind=0.0.0.0 -port=8080  -metricsPort=9325'
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1}
      - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2}
      - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3}
    environment:
      - TZ=Asia/Shanghai
  seaweedfs-filer:
    image: chrislusf/seaweedfs:3.99
    depends_on:
      - seaweedfs-master
      - seaweedfs-volume
    container_name: ${CONTAINER_NAME}-filer
    restart: always
    networks:
      - seaweedfs-network
    ports:
      - ${PANEL_APP_PORT_FILER_SERVER}:8888
      - ${PANEL_APP_PORT_FILER_API}:18888
      - ${PANEL_APP_PORT_FILER_METRICS}:9326
    command: 'filer -master="seaweedfs-master:9333" -ip.bind=0.0.0.0 -metricsPort=9326'
    tty: true
    stdin_open: true
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1}
      - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2}
      - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3}
    environment:
      - TZ=Asia/Shanghai
  seaweedfs-s3:
    image: chrislusf/seaweedfs:3.99
    depends_on:
      - seaweedfs-master
      - seaweedfs-volume
      - seaweedfs-filer
    container_name: ${CONTAINER_NAME}
    labels:
      createdBy: "Apps"
    restart: always
    networks:
      - seaweedfs-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8333
      - ${PANEL_APP_PORT_S3_METRICS}:9327
    command: 's3 -filer="seaweedfs-filer:8888" -ip.bind=0.0.0.0 -metricsPort=9327'
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1}
      - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2}
      - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3}
    environment:
      - TZ=Asia/Shanghai
  seaweedfs-webdav:
    image: chrislusf/seaweedfs:3.99
    depends_on:
      - seaweedfs-master
      - seaweedfs-volume
      - seaweedfs-filer
    container_name: ${CONTAINER_NAME}-webdav
    restart: always
    networks:
      - seaweedfs-network
    ports:
      - ${PANEL_APP_PORT_WEBDAV}:7333
    command: 'webdav -filer="seaweedfs-filer:8888"'
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1}
      - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2}
      - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3}
    environment:
      - TZ=Asia/Shanghai
  seaweedfs-prometheus:
    image: prom/prometheus:v2.21.0
    depends_on:
      - seaweedfs-s3
    container_name: ${CONTAINER_NAME}-prometheus
    restart: always
    networks:
      - seaweedfs-network
    ports:
      - ${PANEL_APP_PORT_METRICS}:9090
    command: --web.enable-lifecycle  --config.file=/etc/prometheus/prometheus.yml
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${SEAWEEDFS_ROOT_PATH}/prometheus:/etc/prometheus
    environment:
      - TZ=Asia/Shanghai
