mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-10 23:47:29 +00:00
fix: Docker entrypoint 以 root 运行再降权,彻底解决 volume 权限问题
去掉 USER appuser,entrypoint 以 root 身份运行,先 chown 修复 volume 挂载目录的权限,再通过 su 降权到 appuser 执行应用。
This commit is contained in:
9
docker-entrypoint.sh
Normal file
9
docker-entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Fix permissions on volume-mounted directories (runs as root)
|
||||
chown -R appuser:appgroup /app/db /app/logs /app/resources 2>/dev/null || true
|
||||
|
||||
# Run Java directly - entrypoint is PID 1, exec makes Java PID 1
|
||||
# Docker SIGTERM goes directly to Java, triggering ShutdownHook
|
||||
exec java -Xmx${JVM_XMX:-512M} ${JVM_OPTS} -jar /app/netdisk-fast-download.jar
|
||||
Reference in New Issue
Block a user