Update Dockerfile
Browse files- Dockerfile +19 -22
Dockerfile
CHANGED
|
@@ -1,33 +1,30 @@
|
|
| 1 |
-
# 1.
|
| 2 |
FROM debian:11-slim
|
| 3 |
|
| 4 |
-
# Set environment variables
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
ENV HOME=/home/user \
|
| 7 |
PATH=/home/user/.local/bin:$PATH
|
| 8 |
|
| 9 |
-
# 2. Install
|
| 10 |
-
RUN apt-get update && apt-get install -y \
|
| 11 |
-
curl \
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
&& apt-get install -y nodejs \
|
| 16 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
# 3.
|
| 19 |
-
RUN
|
|
|
|
| 20 |
|
| 21 |
-
# 4.
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
| 30 |
-
EXPOSE 7860
|
| 31 |
|
| 32 |
-
# 6. Start VS Code
|
| 33 |
-
CMD ["code-server", "--
|
|
|
|
| 1 |
+
# 1. Base Image
|
| 2 |
FROM debian:11-slim
|
| 3 |
|
|
|
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
ENV HOME=/home/user \
|
| 6 |
PATH=/home/user/.local/bin:$PATH
|
| 7 |
|
| 8 |
+
# 2. Install Node and VS Code
|
| 9 |
+
RUN apt-get update && apt-get install -y curl git sudo && \
|
| 10 |
+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 11 |
+
apt-get install -y nodejs && \
|
| 12 |
+
curl -fsSL https://code-server.dev/install.sh | sh && \
|
| 13 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
# 3. Setup User
|
| 16 |
+
RUN useradd -m -u 1000 user
|
| 17 |
+
WORKDIR $HOME/app
|
| 18 |
|
| 19 |
+
# 4. PRE-CREATE CONFIG DIR AND COPY YOUR FILE
|
| 20 |
+
# We create the folder first, then copy the file into it
|
| 21 |
+
RUN mkdir -p $HOME/.config/code-server
|
| 22 |
+
COPY --chown=user:user config.yaml $HOME/.config/code-server/config.yaml
|
| 23 |
|
| 24 |
+
# 5. Fix permissions for the entire home directory
|
| 25 |
+
RUN chown -R user:user $HOME
|
| 26 |
|
| 27 |
+
USER user
|
|
|
|
| 28 |
|
| 29 |
+
# 6. Start VS Code using that config file
|
| 30 |
+
CMD ["code-server", "--config", "/home/user/.config/code-server/config.yaml", "."]
|