fix(docker): let cloudreve receive SIGTERM by exec-ing it as PID 1

The image entrypoint is `sh ./entrypoint.sh`, so the shell stays PID 1
and cloudreve runs as its child. SIGTERM from `docker stop` is sent to
PID 1 (sh): as PID 1 without an installed handler the kernel drops it,
and the shell would not forward it to children anyway. The container is
therefore only stopped by SIGKILL after the stop timeout (10s default),
which also hard-kills supervisord/aria2.

Use `exec ./cloudreve` so the binary replaces the shell as PID 1 and
receives SIGTERM directly for graceful shutdown.
pull/3602/head
ZhengKeli 6 days ago
parent 9f1e0b8333
commit 5dff444de2

@ -1,2 +1,2 @@
supervisord -c ./aria2.supervisor.conf supervisord -c ./aria2.supervisor.conf
./cloudreve exec ./cloudreve
Loading…
Cancel
Save