File size: 2,753 Bytes
83898cd
 
 
 
cfbdec6
83898cd
 
cfbdec6
2110ec0
cfbdec6
 
 
 
 
 
 
2110ec0
 
cfbdec6
83898cd
 
 
 
cf323e6
cfbdec6
cf323e6
cfbdec6
cf323e6
 
196a94e
cfbdec6
83898cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2110ec0
 
 
 
83898cd
 
 
 
 
 
 
 
 
2110ec0
cfbdec6
 
 
2110ec0
cfbdec6
 
 
 
2110ec0
 
 
cfbdec6
 
6ba0c32
 
 
83898cd
 
 
cfbdec6
83898cd
 
cfbdec6
2110ec0
83898cd
 
2110ec0
 
 
 
 
 
 
 
 
 
83898cd
cfbdec6
83898cd
cfbdec6
2110ec0
 
 
cfbdec6
83898cd
 
 
d88ab11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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"]