Files
any-auto-register/docker-entrypoint.sh
2026-03-22 21:01:31 +08:00

23 lines
574 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
# 启动虚拟显示
Xvfb :99 -screen 0 1280x800x24 -nolisten tcp &
export DISPLAY=:99
# 等待 Xvfb 就绪
sleep 1
# 启动 x11vnc无密码仅本地 VNC
if [ -n "$VNC_PASSWORD" ]; then
x11vnc -display :99 -rfbauth <(x11vnc -storepasswd "$VNC_PASSWORD" /tmp/vncpass && echo /tmp/vncpass) -forever -shared &
else
x11vnc -display :99 -nopw -forever -shared &
fi
# 启动 noVNC端口 6080 -> VNC 5900
websockify --web=/usr/share/novnc 6080 localhost:5900 &
# 启动 FastAPI 后端
exec uvicorn main:app --host 0.0.0.0 --port 8000