File size: 938 Bytes
9005efe
 
 
 
 
 
 
327c113
9005efe
327c113
 
 
 
9005efe
327c113
 
9005efe
327c113
 
9005efe
327c113
 
 
 
9005efe
327c113
9005efe
327c113
 
9005efe
7a0ea9b
 
1
2
3
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
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update && apt-get install -y curl python3.11 python3-pip libmagic1 \
    speedtest-cli neofetch ffmpeg imagemagick git git-lfs zip wget unzip yarn \
    whois software-properties-common npm

# Install Node.js and global npm packages
RUN npm install n -g && n 20
RUN npm install npm@latest -g
RUN npm install -g pm2 yarn

# Create a user named 'ramm'
RUN useradd -m -u 1000 ramm

# Install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Switch to 'ramm' user
USER ramm
ENV HOME=/home/ramm \
    PATH=/home/ramm/.local/bin:$PATH

WORKDIR $HOME

# Copy files into the container and set permissions for the 'ramm' user
COPY --chown=ramm . $HOME/server

# Start code-server using PM2 (Ensure correct syntax and options)
CMD ["pm2-runtime", "start", "code-server", "--", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]