Skip to content

Instantly share code, notes, and snippets.

@Neirth
Created May 17, 2023 23:43
Show Gist options
  • Select an option

  • Save Neirth/6d2fd5c5a63e7420ed927c0b7aea0ef2 to your computer and use it in GitHub Desktop.

Select an option

Save Neirth/6d2fd5c5a63e7420ed927c0b7aea0ef2 to your computer and use it in GitHub Desktop.

Revisions

  1. Neirth created this gist May 17, 2023.
    42 changes: 42 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    FROM alpine:edge

    # Install the rest of dependencies inside minio image
    RUN apk add minio supervisor rclone fuse3

    # Prepare data temp folder
    RUN mkdir -p /data/backup

    # Configure rclone remote path
    ENV REMOTE_PATH

    # Configure supervisord for interact with minio and rclone
    RUN echo -e ' \n\
    [supervisord] \n\
    nodaemon=true \n\
    user=root \n\
    loglevel=info \n\
    \n\
    [program:minio] \n\
    command=/bin/sh -c "sleep 5 && minio server /data --console-address 0.0.0.0:9001" \n\
    stdout_logfile=/dev/stdout \n\
    stdout_logfile_maxbytes=0 \n\
    stderr_logfile=/dev/stderr \n\
    stderr_logfile_maxbytes=0 \n\
    \n\
    [program:rclone] \n\
    command=/bin/sh -c "/usr/bin/rclone --config=/etc/rclone.conf mount $REMOTE_PATH /data/ --vfs-cache-mode writes --cache-dir /tmp --allow-non-empty" \n\
    stdout_logfile=/dev/stdout \n\
    stdout_logfile_maxbytes=0 \n\
    stderr_logfile=/dev/stderr \n\
    stderr_logfile_maxbytes=0 \n\
    ' >> /etc/supervisord.conf

    # Expose minio ports
    EXPOSE 9000
    EXPOSE 9001

    # Configure exposable rclone config
    VOLUME ["/etc/rclone/config"]

    # Set the entrypoint for supervisord
    ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]