Last active
November 15, 2024 16:42
-
-
Save dbiesecke/f5120a12afb486fa1b82334f52493c91 to your computer and use it in GitHub Desktop.
RClone Docker Compose file - with rcd & additional options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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