feat: startup and update script optimization
1. 修复Shellcheck指出的问题,增强脚本稳定性。 2. 对于更新部分:采取先更新主程序和前端,插件和资源包再更新的原则;主要解决如果插件或资源包没有下载成功,主程序就无法更新成功的问题,但是其实资源包和插件是不影响主程序更新的。 Co-Authored-By: DDSDerek <108336573+DDSDerek@users.noreply.github.com> Co-Authored-By: Summer⛱ <57806936+honue@users.noreply.github.com>
This commit is contained in:
12
entrypoint
12
entrypoint
@ -1,17 +1,19 @@
|
||||
#!/bin/bash
|
||||
# shellcheck shell=bash
|
||||
# shellcheck disable=SC2016
|
||||
|
||||
# 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值
|
||||
envsubst '${NGINX_PORT}${PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
|
||||
# 自动更新
|
||||
cd /
|
||||
/usr/local/bin/mp_update
|
||||
cd /app
|
||||
cd /app || exit
|
||||
# 更改 moviepilot userid 和 groupid
|
||||
groupmod -o -g ${PGID} moviepilot
|
||||
usermod -o -u ${PUID} moviepilot
|
||||
groupmod -o -g "${PGID}" moviepilot
|
||||
usermod -o -u "${PUID}" moviepilot
|
||||
# 更改文件权限
|
||||
chown -R moviepilot:moviepilot \
|
||||
${HOME} \
|
||||
"${HOME}" \
|
||||
/app \
|
||||
/public \
|
||||
/config \
|
||||
@ -27,6 +29,6 @@ if [ -S "/var/run/docker.sock" ]; then
|
||||
haproxy -f /app/haproxy.cfg
|
||||
fi
|
||||
# 设置后端服务权限掩码
|
||||
umask ${UMASK}
|
||||
umask "${UMASK}"
|
||||
# 启动后端服务
|
||||
exec dumb-init gosu moviepilot:moviepilot python3 app/main.py
|
||||
|
Reference in New Issue
Block a user