Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +21 -20
Dockerfile
CHANGED
|
@@ -5,31 +5,32 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|
| 5 |
# Install necessary packages
|
| 6 |
RUN apt-get update && apt-get install -y curl python3.11 python3-pip libmagic1 \
|
| 7 |
speedtest-cli neofetch ffmpeg imagemagick git git-lfs zip wget unzip yarn \
|
| 8 |
-
|
| 9 |
|
| 10 |
-
# Install Node.js and global npm packages
|
| 11 |
-
RUN npm install n -g && n 20
|
| 12 |
-
RUN npm install npm@latest -g
|
| 13 |
-
RUN npm install -g pm2 yarn
|
| 14 |
|
| 15 |
-
# Create a user named 'ramm'
|
| 16 |
-
RUN useradd -m -u 1000 ramm
|
| 17 |
|
| 18 |
-
# Install code-server
|
| 19 |
-
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 20 |
|
| 21 |
-
# Switch to 'ramm' user
|
| 22 |
-
USER ramm
|
| 23 |
-
ENV HOME=/home/ramm \
|
| 24 |
-
|
| 25 |
|
| 26 |
-
WORKDIR $HOME
|
| 27 |
|
| 28 |
-
# Copy files into the container and set permissions for the 'ramm' user
|
| 29 |
-
COPY --chown=ramm . $HOME/server
|
| 30 |
|
| 31 |
-
# Run code-server with no authentication and bind to the correct address
|
| 32 |
-
CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
|
| 33 |
|
| 34 |
-
# Ensure the container keeps running using PM2
|
| 35 |
-
CMD ["pm2-runtime", "start", "code-server"]
|
|
|
|
|
|
| 5 |
# Install necessary packages
|
| 6 |
RUN apt-get update && apt-get install -y curl python3.11 python3-pip libmagic1 \
|
| 7 |
speedtest-cli neofetch ffmpeg imagemagick git git-lfs zip wget unzip yarn \
|
| 8 |
+
whois software-properties-common npm
|
| 9 |
|
| 10 |
+
# Install Node.js and global npm packages
|
| 11 |
+
RUN npm install n -g && n 20
|
| 12 |
+
RUN npm install npm@latest -g
|
| 13 |
+
RUN npm install -g pm2 yarn
|
| 14 |
|
| 15 |
+
# Create a user named 'ramm'
|
| 16 |
+
RUN useradd -m -u 1000 ramm
|
| 17 |
|
| 18 |
+
# Install code-server
|
| 19 |
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 20 |
|
| 21 |
+
# Switch to 'ramm' user
|
| 22 |
+
USER ramm
|
| 23 |
+
ENV HOME=/home/ramm \
|
| 24 |
+
PATH=/home/ramm/.local/bin:$PATH
|
| 25 |
|
| 26 |
+
WORKDIR $HOME
|
| 27 |
|
| 28 |
+
# Copy files into the container and set permissions for the 'ramm' user
|
| 29 |
+
COPY --chown=ramm . $HOME/server
|
| 30 |
|
| 31 |
+
# Run code-server with no authentication and bind to the correct address
|
| 32 |
+
CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
|
| 33 |
|
| 34 |
+
# Ensure the container keeps running using PM2
|
| 35 |
+
CMD ["pm2-runtime", "start", "code-server"]
|
| 36 |
+
|