This commit is contained in:
mshe 2026-06-15 17:24:52 +08:00
parent 76aeff861e
commit 07c00dddd6
1 changed files with 9 additions and 8 deletions

View File

@ -22,14 +22,15 @@ RUN rm -f /etc/nginx/sites-enabled/default
RUN cat > /entrypoint.sh << 'EOF'
#!/bin/bash
VNC_PWD=${VNC_PASSWORD:-"123456"}
VNC_PORT=${VNC_PORT:-5900}
DISPLAY_NUM=${DISPLAY_NUM:-99}
TARGET_URL=${TARGET_URL:-"https://www.baidu.com"}
# VNC_PWD=${VNC_PASSWORD:-"123456"}
# VNC_PORT=${VNC_PORT:-5900}
# DISPLAY_NUM=${DISPLAY_NUM:-99}
# TARGET_URL=${TARGET_URL:-"https://www.baidu.com"}
TARGET_URL=${TARGET_URL:-"blank"}
Xvfb :${DISPLAY_NUM} -screen 0 1280x1024x24 &
Xvfb :99 -screen 0 1280x1024x24 &
sleep 2
export DISPLAY=:${DISPLAY_NUM}
export DISPLAY=:99
CHROME_BIN=$(find /ms-playwright -name "chrome" -type f -executable 2>/dev/null | head -1)
if [ -z "$CHROME_BIN" ]; then
@ -45,9 +46,9 @@ fi
--disable-features=IsolateOrigins,site-per-process \
"${TARGET_URL}" &
x11vnc -display :${DISPLAY_NUM} -forever -shared -passwd "${VNC_PWD}" -rfbport ${VNC_PORT} &
x11vnc -display :99 -forever -shared -rfbport 5900 &
/opt/novnc/utils/novnc_proxy --vnc localhost:${VNC_PORT} --listen 6080 &
/opt/novnc/utils/novnc_proxy --vnc localhost:5900 --listen 6080 &
# 启动 nginx
nginx &