jsontext1000 / Dockerfile
zhuhai111's picture
Update Dockerfile
fee92e1 verified
FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
# 安装 LXDE、TigerVNC 及依赖
RUN apt-get update \
&& apt-get install -y lxde tigervnc-standalone-server tigervnc-common dbus-x11 xfonts-base \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# 创建 1000 用户
RUN useradd -m -u 1000 user \
&& mkdir -p /home/user/.vnc /workspace \
&& chown -R user:user /home/user /workspace
COPY ssh_client.py /workspace/ssh_client.py
COPY config.json /workspace/config.json
USER user
WORKDIR /workspace
# 启动 VNC 服务和 LXDE 桌面,并后台运行 ssh_client.py
CMD bash -c "vncserver :1 -geometry 1280x800 -depth 24 -localhost no -SecurityTypes None && (python ssh_client.py -c config.json &) && tail -f /home/user/.vnc/*.log"