Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yufree authored Aug 29, 2024
1 parent 40c33a8 commit dcc791e
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions deepspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,40 @@ FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu24.04

ENV DEBIAN_FRONTEND noninteractive

# Install necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
curl \
software-properties-common \
python3-full \
python3 \
python3-pip \
python3-venv \
nodejs \
npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Install code-server
RUN wget https://github.com/cdr/code-server/releases/download/v4.92.2/code-server_4.92.2_amd64.deb \
&& dpkg -i code-server_4.92.2_amd64.deb \
&& rm code-server_4.92.2_amd64.deb
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Create a virtual environment and install Jupyter
# Create a virtual environment
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip3 install --no-cache-dir jupyter

EXPOSE 8080 8888
# Install Jupyter and ipykernel in the virtual environment
RUN pip install jupyter ipykernel

# Start both code-server and Jupyter Notebook
CMD code-server --bind-addr 0.0.0.0:8080 & jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root
# Register the kernel with Jupyter
RUN ipython kernel install --name "python3" --user

# Install some common VS Code extensions
RUN code-server --install-extension ms-python.python \
&& code-server --install-extension ms-toolsai.jupyter

# Expose port for code-server
EXPOSE 8080

# Start code-server
CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "password"]

0 comments on commit dcc791e

Please sign in to comment.