fix: optimize init script command order

This commit is contained in:
DDSDerek 2023-07-29 08:27:41 +08:00 committed by GitHub
parent b82f9725e9
commit bbde312297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,17 @@
#!/bin/sh #!/bin/bash
umask ${UMASK}
# 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值 # 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值
envsubst '${NGINX_PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf envsubst '${NGINX_PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
# 更改 moviepilot userid 和 groupid # 更改 moviepilot userid 和 groupid
groupmod -o -g ${PGID} moviepilot groupmod -o -g ${PGID} moviepilot
usermod -o -u ${PUID} moviepilot usermod -o -u ${PUID} moviepilot
# 更改文件权限
chown -R moviepilot:moviepilot ${HOME} /app /config chown -R moviepilot:moviepilot ${HOME} /app /config
# 下载浏览器内核 # 下载浏览器内核
gosu moviepilot:moviepilot playwright install chromium gosu moviepilot:moviepilot playwright install chromium
# 启动前端nginx服务
nginx
# 设置后端服务权限掩码
umask ${UMASK}
# 启动后端服务 # 启动后端服务
exec gosu moviepilot:moviepilot python3 app/main.py exec gosu moviepilot:moviepilot python3 app/main.py