FROM mcr.microsoft.com/playwright:v1.48.0-jammy

ENV DEBIAN_FRONTEND=noninteractive

# ========== 安装 VNC 和nginx 相关软件 ==========
RUN apt-get update && \
    apt-get install -y x11vnc xvfb fluxbox git tigervnc-standalone-server wget curl gnupg2 ca-certificates lsb-release debian-archive-keyring && \ 
    git clone https://github.com/novnc/noVNC.git /opt/novnc && \
    git clone https://github.com/novnc/websockify.git /opt/novnc/utils/websockify && \
    curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null && \
    echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list && \
    apt-get update && \
    apt remove -y nginx nginx-core && \
    apt install -y nginx && \
    rm -rf /var/lib/apt/lists/*