Code-Server_IDE / Dockerfile
NitinBot002's picture
Update Dockerfile
2d3de13 verified
raw
history blame
1.4 kB
FROM codercom/code-server:latest
USER root
RUN apt-get update && \
apt-get install -y curl gnupg lsb-release software-properties-common
RUN echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" \
> /etc/apt/sources.list.d/jammy.list
RUN apt-get update && \
apt-get install -y \
python3.10 python3.10-venv python3.10-dev python3-pip \
build-essential git wget unzip nano zip ca-certificates \
net-tools xz-utils openssh-client && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
ln -sf /usr/bin/python3.10 /usr/bin/python && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
npm install -g npm yarn && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel \
&& pip3 install --no-cache-dir ipython virtualenv jupyter
RUN mkdir -p /home/coder/project && chown -R coder:coder /home/coder/project
USER coder
ENV PASSWORD=hfspacespassword \
PORT=7860 \
HOME=/home/coder
RUN mkdir -p ~/.config/code-server && \
echo '{ \
"bind-addr": "0.0.0.0:7860", \
"auth": "password", \
"password": "'"${PASSWORD}"'", \
"cert": false \
}' > ~/.config/code-server/config.json
WORKDIR /home/coder/project
EXPOSE 7860
CMD ["code-server","--port","7860","/home/coder/project"]