Aproved / Dockerfile
processed's picture
Create Dockerfile
1fc85e7 verified
raw
history blame
1.01 kB
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
# Run code-server with no authentication and bind to the correct address
CMD ["code-server", ".", "--bind-addr", "0.0.0.0:7860", "--auth", "none"]
# Ensure the container keeps running using PM2
CMD ["pm2-runtime", "start", "code-server"]