FROM codercom/code-server:latest USER root # Update system RUN apt-get update && apt-get upgrade -y # Install desktop environment (XFCE - lightweight) RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ xfce4 \ xfce4-goodies \ x11vnc \ xvfb \ supervisor \ net-tools \ novnc \ websockify \ dbus-x11 # Install Node.js RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs # Install Python 3.x and venv RUN apt-get install -y python3 python3-venv python3-pip # Set up Python virtual environment RUN python3 -m venv /home/coder/venv && \ /home/coder/venv/bin/pip install --upgrade pip # Install Playwright dependencies RUN apt-get install -y \ libx11-xcb1 \ libxcb-shm0 \ libxrandr2 \ libxcomposite1 \ libxcursor1 \ libxdamage1 \ libxfixes3 \ libxi6 \ libgtk-3-0 \ libgdk-pixbuf2.0-0 \ libpangocairo-1.0-0 \ libpango-1.0-0 \ libatk1.0-0 \ libcairo-gobject2 \ libcairo2 \ libasound2 \ libxrender1 \ libdbus-1-3 \ libgbm1 \ libnss3 \ libnspr4 # Install Java RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.tar.gz && \ mkdir -p /usr/lib/jvm && \ tar zxvf openjdk-20+36_linux-x64_bin.tar.gz -C /usr/lib/jvm && \ rm openjdk-20+36_linux-x64_bin.tar.gz && \ update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 && \ update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java # Install useful applications RUN apt-get install -y \ firefox-esr \ gedit \ thunar \ file-roller \ git \ curl \ wget \ vim \ htop \ tmux # Configure fixuid RUN curl -L https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid -o /usr/local/bin/fixuid && \ chown root:root /usr/local/bin/fixuid && \ chmod 4755 /usr/local/bin/fixuid && \ mkdir -p /etc/fixuid && \ printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml # Create directories RUN mkdir -p /home/coder/.config && \ mkdir -p /home/coder/.local/share/code-server/User && \ mkdir -p /home/coder/.vnc && \ mkdir -p /var/run/dbus && \ chmod -R 777 /home/coder/ # Create startup script RUN echo '#!/bin/bash\n\ export DISPLAY=:1\n\ Xvfb :1 -screen 0 1920x1080x24 &\n\ sleep 2\n\ startxfce4 &\n\ x11vnc -display :1 -forever -shared -rfbport 5900 -passwd password &\n\ websockify --web=/usr/share/novnc/ 6080 localhost:5900 &\n\ code-server --bind-addr 0.0.0.0:8080 --auth none\n\ ' > /start.sh && chmod +x /start.sh WORKDIR /home/coder/project # Expose ports # 8080: code-server # 5900: VNC # 6080: noVNC (browser-based VNC) EXPOSE 8080 5900 6080 USER coder CMD ["/start.sh"]