| FROM debian:bullseye-slim |
|
|
| |
| 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 --no-install-recommends \ |
| |
| openbox \ |
| |
| tigervnc-standalone-server \ |
| tigervnc-common \ |
| novnc \ |
| websockify \ |
| |
| firefox-esr \ |
| |
| python3 \ |
| python3-pip \ |
| python3-venv \ |
| |
| xdotool \ |
| scrot \ |
| procps \ |
| curl \ |
| ca-certificates \ |
| |
| && apt-get clean \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| 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 mkdir -p /home/vncuser/.config/openbox |
|
|
| |
| RUN echo '#!/bin/bash' > /home/vncuser/.vnc/xstartup && \ |
| echo 'exec openbox-session' >> /home/vncuser/.vnc/xstartup && \ |
| chmod +x /home/vncuser/.vnc/xstartup |
|
|
| USER root |
|
|
| |
| COPY requirements.txt /tmp/requirements.txt |
| RUN pip3 install --no-cache-dir --upgrade pip && \ |
| 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 |
|
|
| |
| COPY scripts/start-desktop.sh /app/scripts/start-desktop.sh |
| RUN chmod +x /app/scripts/start-desktop.sh |
|
|
| |
| EXPOSE ${VNC_PORT} ${NO_VNC_PORT} 7860 8000 |
|
|
| CMD ["/app/scripts/start-desktop.sh"] |
|
|