Skip to content
Snippets Groups Projects
Commit 913450ef authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

adds codeserver and cleans up.

parent ee39ae37
No related branches found
No related tags found
No related merge requests found
...@@ -10,12 +10,28 @@ RUN apt-get update && apt-get install -y \ ...@@ -10,12 +10,28 @@ RUN apt-get update && apt-get install -y \
texlive-latex-extra \ texlive-latex-extra \
vim \ vim \
unzip \ unzip \
zip \ zip && \
&& rm -rf /var/lib/apt/lists/* apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt && \
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && \
locale-gen
# Sets locale as default
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# Sets codeserver directories
ENV CODESERVEREXT_DIR /opt/codeserver/extensions
ENV CODE_WORKINGDIR $HOME/work/src
ENV CODESERVERDATA_DIR $HOME/work/codeserver/data
# Add conda env hook
COPY ./conda-activate.sh /usr/local/bin/before-notebook.d/
# RUN jupyter labextension install @jupyterlab/latex doesn't work with lab 3.0
# SO we test a fork. TODO: Multistage Build
RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
# curl -fsSL https://deb.nodesource.com/setup_15.x | bash - && \
# apt-get update && apt-get install -y --no-install-recommends nodejs gcc g++ make && \
pip install --quiet --no-cache-dir --upgrade \ pip install --quiet --no-cache-dir --upgrade \
jupyter-book==0.10.2 \ jupyter-book==0.10.2 \
jupyter-server-proxy==3.0.2 \ jupyter-server-proxy==3.0.2 \
...@@ -24,27 +40,14 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ ...@@ -24,27 +40,14 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
jupyterlab-system-monitor==0.8.0 && \ jupyterlab-system-monitor==0.8.0 && \
conda install defaults::nb_conda_kernels && \ conda install defaults::nb_conda_kernels && \
npm cache clean --force && \ npm cache clean --force && \
jupyter lab clean && \ echo -e "\e[93m***** Install Jupyter LaTeX ****\e[38;5;241m" && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
# RUN jupyter labextension install @jupyterlab/latex doesn't work with lab 3.0
# SO we test a fork. TODO: Multistage Build
RUN echo -e "\e[93m***** Install Jupyter LaTeX ****\e[38;5;241m" && \
git clone https://github.com/joequant/jupyterlab-latex.git && \ git clone https://github.com/joequant/jupyterlab-latex.git && \
cd jupyterlab-latex && \ cd jupyterlab-latex && \
pip3 install -e . && \ pip3 install -e . && \
jlpm install && \ jlpm install && \
jlpm run build && \ jlpm run build && \
jupyter labextension install . jupyter labextension install . && \
echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \
# Add conda env hook
COPY ./conda-activate.sh /usr/local/bin/before-notebook.d/
ENV CODESERVEREXT_DIR /opt/codeserver/extensions
ENV CODE_WORKINGDIR $HOME/work/src
ENV CODESERVERDATA_DIR $HOME/work/codeserver/data
RUN echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \
curl -fsSL https://code-server.dev/install.sh | sh -s -- --prefix=/opt --method=standalone && \ curl -fsSL https://code-server.dev/install.sh | sh -s -- --prefix=/opt --method=standalone && \
mkdir -p $CODESERVEREXT_DIR && \ mkdir -p $CODESERVEREXT_DIR && \
PATH=/opt/bin:$PATH code-server \ PATH=/opt/bin:$PATH code-server \
...@@ -54,13 +57,18 @@ RUN echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \ ...@@ -54,13 +57,18 @@ RUN echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \
--install-extension redhat.vscode-xml \ --install-extension redhat.vscode-xml \
--install-extension vscode-icons-team.vscode-icons \ --install-extension vscode-icons-team.vscode-icons \
--install-extension SonarSource.sonarlint-vscode \ --install-extension SonarSource.sonarlint-vscode \
--install-extension GabrielBB.vscode-lombok \ # --install-extension GabrielBB.vscode-lombok \
--install-extension james-yu.latex-workshop \
--install-extension jebbs.plantuml && \ --install-extension jebbs.plantuml && \
groupadd codeserver && \ groupadd codeserver && \
chgrp -R codeserver $CODESERVEREXT_DIR &&\ chgrp -R codeserver $CODESERVEREXT_DIR &&\
chmod 770 -R $CODESERVEREXT_DIR && \ chmod 770 -R $CODESERVEREXT_DIR && \
adduser "$NB_USER" codeserver && \ adduser "$NB_USER" codeserver && \
echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \
jupyter lab clean && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER fix-permissions /home/$NB_USER
COPY code-server/codeserver-jupyter_notebook_config.py /tmp/ COPY code-server/codeserver-jupyter_notebook_config.py /tmp/
COPY code-server/icons $HOME/.jupyter/icons COPY code-server/icons $HOME/.jupyter/icons
RUN cat /tmp/codeserver-jupyter_notebook_config.py >> $HOME/.jupyter/jupyter_notebook_config.py RUN cat /tmp/codeserver-jupyter_notebook_config.py >> $HOME/.jupyter/jupyter_notebook_config.py
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment