Sudheer07 commited on
Commit
83898cd
·
verified ·
1 Parent(s): e632ca7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +68 -55
Dockerfile CHANGED
@@ -1,55 +1,68 @@
1
- FROM codercom/code-server:latest
2
-
3
- USER root
4
-
5
- RUN apt-get update && apt-get upgrade -y
6
-
7
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
8
- RUN apt-get install -y nodejs
9
-
10
- # Install dependencies for Playwright
11
- RUN apt-get install -y \
12
- libx11-xcb1 \
13
- libxcb-shm0 \
14
- libxrandr2 \
15
- libxcomposite1 \
16
- libxcursor1 \
17
- libxdamage1 \
18
- libxfixes3 \
19
- libxi6 \
20
- libgtk-3-0 \
21
- libgdk-pixbuf2.0-0 \
22
- libpangocairo-1.0-0 \
23
- libpango-1.0-0 \
24
- libatk1.0-0 \
25
- libcairo-gobject2 \
26
- libcairo2 \
27
- libgdk-pixbuf2.0-0 \
28
- libasound2 \
29
- libxrender1 \
30
- libdbus-1-3
31
-
32
- # Install Java
33
- RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.tar.gz \
34
- && mkdir -p /usr/lib/jvm \
35
- && tar zxvf openjdk-20+36_linux-x64_bin.tar.gz -C /usr/lib/jvm \
36
- && rm openjdk-20+36_linux-x64_bin.tar.gz \
37
- && update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 \
38
- && update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java
39
-
40
- RUN mkdir -p /home/coder/.config
41
- RUN mkdir -p /home/coder/.local/share/code-server/User
42
-
43
- WORKDIR /home/coder/project
44
-
45
- EXPOSE 8080
46
-
47
- VOLUME ["/home/coder/.local", "/home/coder/.config", "/home/coder/project"]
48
-
49
- ENV DOCKER_USER=${USER}
50
-
51
- RUN chmod -R 777 /home/coder/
52
-
53
- RUN id -u coder &>/dev/null || useradd -ms /bin/bash coder
54
-
55
- CMD ["code-server", "--auth", "none", "--host", "0.0.0.0"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 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 dependencies for Playwright
13
+ RUN apt-get install -y \
14
+ libx11-xcb1 \
15
+ libxcb-shm0 \
16
+ libxrandr2 \
17
+ libxcomposite1 \
18
+ libxcursor1 \
19
+ libxdamage1 \
20
+ libxfixes3 \
21
+ libxi6 \
22
+ libgtk-3-0 \
23
+ libgdk-pixbuf2.0-0 \
24
+ libpangocairo-1.0-0 \
25
+ libpango-1.0-0 \
26
+ libatk1.0-0 \
27
+ libcairo-gobject2 \
28
+ libcairo2 \
29
+ libasound2 \
30
+ libxrender1 \
31
+ libdbus-1-3
32
+
33
+ # Install Java
34
+ RUN wget https://download.java.net/openjdk/jdk20/ri/openjdk-20+36_linux-x64_bin.tar.gz && \
35
+ mkdir -p /usr/lib/jvm && \
36
+ tar zxvf openjdk-20+36_linux-x64_bin.tar.gz -C /usr/lib/jvm && \
37
+ rm openjdk-20+36_linux-x64_bin.tar.gz && \
38
+ update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-20/bin/java" 1 && \
39
+ update-alternatives --set java /usr/lib/jvm/jdk-20/bin/java
40
+
41
+ # Configure fixuid to avoid permission issues
42
+ COPY --chown=root:root https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid /usr/local/bin/fixuid
43
+ RUN chmod 4755 /usr/local/bin/fixuid && \
44
+ mkdir -p /etc/fixuid && \
45
+ printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
46
+
47
+ # Create necessary directories
48
+ RUN mkdir -p /home/coder/.config && \
49
+ mkdir -p /home/coder/.local/share/code-server/User && \
50
+ chmod -R 777 /home/coder/
51
+
52
+ WORKDIR /home/coder/project
53
+
54
+ # Set volumes
55
+ VOLUME ["/home/coder/.local", "/home/coder/.config", "/home/coder/project"]
56
+
57
+ # Expose the default port for code-server
58
+ EXPOSE 8080
59
+
60
+ # Set the environment variable for the Docker user
61
+ ENV DOCKER_USER=${USER}
62
+
63
+ # Switch to coder user
64
+ RUN id -u coder &>/dev/null || useradd -ms /bin/bash coder
65
+ USER coder
66
+
67
+ # Start code-server with no authentication
68
+ CMD ["fixuid", "code-server", "--auth", "none", "--host", "0.0.0.0"]