Skip to content

Instantly share code, notes, and snippets.

@dbiesecke
Last active August 24, 2022 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbiesecke/f5120a12afb486fa1b82334f52493c91 to your computer and use it in GitHub Desktop.
Save dbiesecke/f5120a12afb486fa1b82334f52493c91 to your computer and use it in GitHub Desktop.
RClone Docker Compose file - with rcd & additional options
version: '3.5'
networks:
default:
name: rclone
driver: "bridge"
services:
rclone:
image: rclone/rclone:beta
container_name: rclone
restart: unless-stopped
privileged: true
logging:
options:
max-size: "10m"
max-file: "3"
environment:
- PHP_TZ=${TZ}
- PUID=${PUID}
- PGID=${PGID}
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- /etc/localtime:/etc/localtime:ro
- ~/.ssh/authorized_keys:/root/.ssh/authorized_keys:ro
- ${CONFIG_DIR_RCLONE}/:/config/rclone/:ro
- $CACHE_DIR_RCLONE:/cache/
- /mnt:/mnt:shared
security_opt:
- seccomp:unconfined
devices:
- /dev/fuse:/dev/fuse
cap_add:
- SYS_ADMIN
- SETPCAP
- MKNOD
entrypoint: >
sh -c "
set -x
AUTH=\"--rc-addr=:5572 --rc-user=$${WEB_ADMIN_USER} --rc-pass=$$WEB_ADMIN_PASSWORD\"
FILTER=""
FILTER_FILE="/config/rclone/filter.txt"
cat $$FILTER_FILE
[ -f $${FILTER_FILE} ] && {
FILTER=\"--filter-from $${FILTER_FILE}\"
}
rclone rcd --rc-web-gui --rc-serve --rc-web-gui-no-open-browser \
--transfers 8 --rc-web-gui-update -vv --cache-dir /cache $$FILTER $$AUTH &
sleep 3
rclone rc options/set $$AUTH --json {'\"main\": {\"DisableHTTP2\": true, \"MultiThreadStreams\":5, \"BufferSize\":16777216}'}
rclone rc options/set $$AUTH --json {'\"vfs\": {\"CacheMode\": 3, \"GID\": '$$PGID', \"UID\": '$$PUID', \"Umask\": 0, \"CacheMaxAge\":172800000000000, \"ReadAhead\":67108864, \"NoModTime\":true, \"NoChecksum\": true, \"WriteBack\":10000000000}'}
rclone rc options/set $$AUTH --json {'\"mount\": {\"AllowNonEmpty\":"false", \"AllowOther\":"true", \"AsyncRead\":"true"}'}
wait %1
"
ports:
- 5572:5572
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment