Pappu100Code commited on
Commit
cfbdec6
·
verified ·
1 Parent(s): cf323e6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -17
Dockerfile CHANGED
@@ -2,21 +2,32 @@ FROM codercom/code-server:latest
2
 
3
  USER root
4
 
5
- # Update system and install required dependencies
6
  RUN apt-get update && apt-get upgrade -y
7
 
 
 
 
 
 
 
 
 
 
 
 
8
  # Install Node.js
9
  RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
10
  apt-get install -y nodejs
11
 
12
  # Install Python 3.x and venv
13
- RUN apt-get install -y python3 python3-venv
14
 
15
- # Set up a virtual environment for Python
16
  RUN python3 -m venv /home/coder/venv && \
17
  /home/coder/venv/bin/pip install --upgrade pip
18
 
19
- # Install dependencies for Playwright
20
  RUN apt-get install -y \
21
  libx11-xcb1 \
22
  libxcb-shm0 \
@@ -45,32 +56,43 @@ RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.
45
  update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 && \
46
  update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java
47
 
48
- # Download and configure fixuid to avoid permission issues
 
 
 
 
 
 
 
 
 
 
49
  RUN curl -L https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid -o /usr/local/bin/fixuid && \
50
  chown root:root /usr/local/bin/fixuid && \
51
  chmod 4755 /usr/local/bin/fixuid && \
52
  mkdir -p /etc/fixuid && \
53
  printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
54
 
55
- # Create necessary directories
56
  RUN mkdir -p /home/coder/.config && \
57
  mkdir -p /home/coder/.local/share/code-server/User && \
 
58
  chmod -R 777 /home/coder/
59
 
60
- WORKDIR /home/coder/project
 
 
 
61
 
62
- # Set volumes
63
- VOLUME ["/home/coder/.local", "/home/coder/.config", "/home/coder/project"]
 
64
 
65
- # Expose the default port for code-server
66
- EXPOSE 8080
67
 
68
- # Set the environment variable for the Docker user
69
- ENV DOCKER_USER=${USER}
70
 
71
- # Switch to coder user
72
- RUN id -u coder &>/dev/null || useradd -ms /bin/bash coder
73
  USER coder
74
 
75
- # Activate the virtual environment and start code-server
76
- CMD ["fixuid", "/home/coder/venv/bin/code-server", "--auth", "none", "--host", "0.0.0.0"]
 
2
 
3
  USER root
4
 
5
+ # Update system
6
  RUN apt-get update && apt-get upgrade -y
7
 
8
+ # Install desktop environment (XFCE - lightweight)
9
+ RUN apt-get install -y \
10
+ xfce4 \
11
+ xfce4-goodies \
12
+ x11vnc \
13
+ xvfb \
14
+ supervisor \
15
+ net-tools \
16
+ novnc \
17
+ websockify
18
+
19
  # Install Node.js
20
  RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
21
  apt-get install -y nodejs
22
 
23
  # Install Python 3.x and venv
24
+ RUN apt-get install -y python3 python3-venv python3-pip
25
 
26
+ # Set up Python virtual environment
27
  RUN python3 -m venv /home/coder/venv && \
28
  /home/coder/venv/bin/pip install --upgrade pip
29
 
30
+ # Install Playwright dependencies
31
  RUN apt-get install -y \
32
  libx11-xcb1 \
33
  libxcb-shm0 \
 
56
  update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 && \
57
  update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java
58
 
59
+ # Install useful tools
60
+ RUN apt-get install -y \
61
+ firefox-esr \
62
+ gedit \
63
+ file-roller \
64
+ git \
65
+ curl \
66
+ wget \
67
+ vim
68
+
69
+ # Configure fixuid
70
  RUN curl -L https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid -o /usr/local/bin/fixuid && \
71
  chown root:root /usr/local/bin/fixuid && \
72
  chmod 4755 /usr/local/bin/fixuid && \
73
  mkdir -p /etc/fixuid && \
74
  printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
75
 
76
+ # Create directories
77
  RUN mkdir -p /home/coder/.config && \
78
  mkdir -p /home/coder/.local/share/code-server/User && \
79
+ mkdir -p /home/coder/.vnc && \
80
  chmod -R 777 /home/coder/
81
 
82
+ # Setup VNC
83
+ RUN mkdir -p /root/.vnc && \
84
+ echo "password" | vncpasswd -f > /root/.vnc/passwd && \
85
+ chmod 600 /root/.vnc/passwd
86
 
87
+ # Create supervisor config
88
+ RUN mkdir -p /var/log/supervisor
89
+ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
90
 
91
+ WORKDIR /home/coder/project
 
92
 
93
+ # Expose ports
94
+ EXPOSE 8080 5900 6080
95
 
 
 
96
  USER coder
97
 
98
+ CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]