Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +68 -55
Dockerfile
CHANGED
|
@@ -1,55 +1,68 @@
|
|
| 1 |
-
FROM codercom/code-server:latest
|
| 2 |
-
|
| 3 |
-
USER root
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|