5ebe562a62
之前用 nginx 做反代是从 cmd/gui/gui.go 的双端口架构沿袭下来的,
没必要——rclone rcd 的 --rc-files 参数本来就能用 http.FileServer
服务静态文件,--rc-serve 服务远端文件下载,浏览器同源访问无需
CORS、无需双端口、无需额外镜像。
- 删除 Dockerfile.webgui、docker/nginx.conf、docker/、.dockerignore
(单容器用官方 rclone/rclone 镜像,不再需要构建前端镜像)
- docker-compose.yml: 单服务 rclone rcd,5580 端口同时承担:
* GET / 静态前端 (--rc-files=/web)
* POST /* RC API(内置)
* GET /<remote>:* 远端文件下载 (--rc-serve)
webgui/web/ 只读挂载到 /web
- README: 移除 nginx 说明,标注后续 TLS / 自定义 header 由用户
自行在前面加反代
55 lines
1.8 KiB
YAML
55 lines
1.8 KiB
YAML
# Docker Compose stack for the rclone webgui.
|
|
#
|
|
# A single rclone rcd container does all three jobs on one port:
|
|
# - Serves the static frontend from webgui/web/ (--rc-files)
|
|
# - Serves RC API endpoints at POST /* (built-in)
|
|
# - Serves remote files at GET /<remote>:<path> (--rc-serve)
|
|
#
|
|
# Same-origin from the browser, so no CORS / no nginx / no double ports.
|
|
# For TLS or custom headers, put a reverse proxy of your choice in front.
|
|
#
|
|
# rclone config lives in ./config/rclone/rclone.conf (bind-mounted).
|
|
# If it doesn't exist yet, create your remotes with:
|
|
# docker compose exec rclone rclone config
|
|
# or copy an existing rclone.conf into ./config/rclone/ before starting.
|
|
#
|
|
# Usage:
|
|
# docker compose up -d # start
|
|
# open http://localhost:5580
|
|
# docker compose logs -f rclone # tail logs
|
|
# docker compose down # stop
|
|
|
|
services:
|
|
rclone:
|
|
image: rclone/rclone:latest
|
|
container_name: rclone-webgui
|
|
command:
|
|
- rcd
|
|
- --rc-no-auth
|
|
- --rc-addr=:8080
|
|
- --rc-files=/web
|
|
- --rc-serve
|
|
- --rc-job-expire-duration=24h
|
|
- --rc-job-expire-interval=1m
|
|
- -vv
|
|
volumes:
|
|
# Static frontend served by rclone's own http.FileServer.
|
|
- ./webgui/web:/web:ro
|
|
# rclone looks for $XDG_CONFIG_HOME/rclone/rclone.conf; the
|
|
# official image sets XDG_CONFIG_HOME=/config.
|
|
- ./config/rclone:/config/rclone
|
|
# Cache dir for tokens, chunk cache, vfs cache, etc.
|
|
- rclone-cache:/cache
|
|
# Scratch space for any local-FS remotes that point here.
|
|
- rclone-data:/data
|
|
environment:
|
|
- XDG_CONFIG_HOME=/config
|
|
- RCLONE_CACHE_DIR=/cache
|
|
ports:
|
|
- "5580:8080"
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
rclone-cache:
|
|
rclone-data:
|