You've already forked pruchase_jhw
Docker打包
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# VNC 密码必填,避免远程桌面裸奔
|
||||
: "${VNC_PASSWORD:?必须通过环境变量 VNC_PASSWORD 设置 noVNC/VNC 访问密码}"
|
||||
|
||||
mkdir -p /archives /logs /app/config /app/chrome-profile
|
||||
|
||||
# 生成 x11vnc 密码文件
|
||||
x11vnc -storepasswd "$VNC_PASSWORD" /root/.vncpass > /dev/null 2>&1
|
||||
|
||||
# 挂载的配置目录中没有 accounts.yaml 时,用镜像内模板初始化
|
||||
if [ ! -f /app/config/accounts.yaml ] && [ -f /app/deploy-defaults/accounts.yaml ]; then
|
||||
echo "[entrypoint] /app/config/accounts.yaml 不存在,使用镜像内模板初始化。"
|
||||
cp /app/deploy-defaults/accounts.yaml /app/config/accounts.yaml
|
||||
fi
|
||||
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||
@@ -0,0 +1,66 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/dev/null
|
||||
logfile_maxbytes=0
|
||||
pidfile=/tmp/supervisord.pid
|
||||
|
||||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock
|
||||
|
||||
; ---------- 虚拟桌面 ----------
|
||||
[program:xvfb]
|
||||
command=/usr/bin/Xvfb %(ENV_DISPLAY)s -screen 0 %(ENV_SCREEN_RES)s -ac -nolisten tcp
|
||||
priority=10
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
|
||||
[program:fluxbox]
|
||||
command=/usr/bin/fluxbox
|
||||
priority=20
|
||||
autorestart=true
|
||||
startretries=10
|
||||
stdout_logfile=/dev/null
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
|
||||
; ---------- VNC / noVNC ----------
|
||||
[program:x11vnc]
|
||||
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbauth /root/.vncpass -rfbport 5900 -forever -shared -noxdamage -quiet
|
||||
priority=30
|
||||
autorestart=true
|
||||
startretries=10
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
|
||||
[program:novnc]
|
||||
command=/usr/bin/websockify --web /usr/share/novnc 6080 localhost:5900
|
||||
priority=40
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
|
||||
; ---------- 业务进程 ----------
|
||||
; autorestart=true:进程任何形式退出都会被拉起,
|
||||
; 配合 API 的 POST /api/restart(SIGTERM 优雅停机)实现"保存配置后重启"。
|
||||
[program:app]
|
||||
command=/app/.venv/bin/python -m src.main
|
||||
directory=/app
|
||||
priority=50
|
||||
autorestart=true
|
||||
startretries=3
|
||||
stopsignal=TERM
|
||||
stopwaitsecs=120
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
redirect_stderr=true
|
||||
Reference in New Issue
Block a user