| FROM ubuntu:22.04 |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV DISPLAY=:1 |
| ENV VNC_PORT=5901 |
| ENV NO_VNC_PORT=6080 |
| ENV VNC_PASSWORD=vncpassword |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| |
| xfce4 \ |
| xfce4-goodies \ |
| xfce4-terminal \ |
| lxqt \ |
| mate-desktop-environment \ |
| mate-terminal \ |
| lightdm \ |
| dbus-x11 \ |
| openbox \ |
| obconf \ |
| |
| tigervnc-standalone-server \ |
| tigervnc-common \ |
| |
| novnc \ |
| websockify \ |
| |
| gimp \ |
| firefox \ |
| libreoffice \ |
| thunar \ |
| mousepad \ |
| |
| wget \ |
| curl \ |
| git \ |
| vim \ |
| nano \ |
| htop \ |
| file \ |
| unzip \ |
| zip \ |
| |
| python3 \ |
| python3-pip \ |
| python3-venv \ |
| |
| xdotool \ |
| scrot \ |
| imagemagick \ |
| wmctrl \ |
| |
| fonts-liberation \ |
| fonts-dejavu \ |
| |
| && apt-get clean \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN apt-get update && apt-get install -y openssl && \ |
| apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN openssl req -x509 -newkey rsa:4096 -keyout /etc/ssl/private/selfsigned.key -out /etc/ssl/certs/selfsigned.crt -days 365 -nodes -subj "/C=US/ST=State/L=City/O=Organization/CN=localhost" |
|
|
| |
| RUN pip3 install --no-cache-dir playwright && \ |
| playwright install firefox && \ |
| playwright install-deps firefox |
|
|
| |
| RUN useradd -m -s /bin/bash vncuser && \ |
| mkdir -p /home/vncuser/.vnc && \ |
| chown -R vncuser:vncuser /home/vncuser |
|
|
| |
| USER vncuser |
| RUN echo "${VNC_PASSWORD}" | vncpasswd -f > /home/vncuser/.vnc/passwd && \ |
| chmod 600 /home/vncuser/.vnc/passwd |
|
|
| |
| RUN echo '#!/bin/bash' > /home/vncuser/.vnc/xstartup && \ |
| echo 'unset SESSION_MANAGER' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'unset DBUS_SESSION_BUS_ADDRESS' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'export XKL_XMODMAP_DISABLE=1' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'if [ "$DESKTOP_ENV" = "lxqt" ]; then' >> /home/vncuser/.vnc/xstartup && \ |
| echo ' exec startlxqt' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'elif [ "$DESKTOP_ENV" = "mate" ]; then' >> /home/vncuser/.vnc/xstartup && \ |
| echo ' exec mate-session' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'elif [ "$DESKTOP_ENV" = "openbox" ]; then' >> /home/vncuser/.vnc/xstartup && \ |
| echo ' exec openbox-session' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'else' >> /home/vncuser/.vnc/xstartup && \ |
| echo ' exec startxfce4' >> /home/vncuser/.vnc/xstartup && \ |
| echo 'fi' >> /home/vncuser/.vnc/xstartup && \ |
| chmod +x /home/vncuser/.vnc/xstartup |
|
|
| USER root |
|
|
| |
| COPY requirements.txt /tmp/requirements.txt |
| RUN pip3 install --no-cache-dir -r /tmp/requirements.txt |
|
|
| |
| WORKDIR /app |
| COPY . /app |
|
|
| |
| RUN mkdir -p /app/scripts /app/agent /app/logs && \ |
| chown -R vncuser:vncuser /app |
|
|
| |
| EXPOSE ${VNC_PORT} ${NO_VNC_PORT} 7860 8000 |
|
|
| |
| COPY scripts/start-desktop.sh /app/scripts/start-desktop.sh |
| RUN chmod +x /app/scripts/start-desktop.sh |
|
|
| |
| CMD ["/app/scripts/start-desktop.sh"] |
|
|