Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +18 -22
Dockerfile
CHANGED
|
@@ -5,32 +5,28 @@ 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 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
# Ensure the container keeps running using PM2
|
| 35 |
-
CMD ["pm2-runtime", "start", "code-server"]
|
| 36 |
-
|
|
|
|
| 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 |
+
# Start code-server using PM2
|
| 32 |
+
CMD ["pm2-runtime", "start", "code-server", "--", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
|
|
|
|
|
|
|
|
|
|
|
|