diff --git a/Dockerfile b/Dockerfile index ed8093e..58b8839 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ FROM codercom/code-server:4.4.0 ARG PYTHON_VERSION=3.10 -ARG QUARTO_VERSION="0.9.393" USER root -# Install common softwares +# Install system libraries RUN apt-get -y update && \ curl -s https://raw.githubusercontent.com/InseeFrLab/onyxia/main/resources/common-software-docker-images.sh | bash -s && \ apt-get install -y --no-install-recommends cmake g++ && \ rm -rf /var/lib/apt/lists/* # Install QUARTO +ARG QUARTO_VERSION="0.9.508" RUN wget "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb" RUN apt install "./quarto-${QUARTO_VERSION}-linux-amd64.deb" @@ -30,14 +30,20 @@ RUN conda create -n basesspcloud python=$PYTHON_VERSION COPY environment.yml . RUN mamba env update -n basesspcloud -f environment.yml -# Make basesspcloud env activated by default in shells +# Use basesspcloud env by default +RUN echo '. "/home/coder/local/bin/conda/etc/profile.d/conda.sh"' >> /home/coder/.bashrc +RUN echo 'conda activate basesspcloud' >> /home/coder/.bashrc ENV PATH="/home/coder/local/bin/conda/envs/basesspcloud/bin:${PATH}" -RUN echo "export PATH=$PATH" >> /home/coder/.bashrc # Temporary fix while PATH gets overwritten by code-server +RUN echo "export PATH=$PATH" >> /home/coder/.bashrc + +# Switch back to non-root user +USER coder # Additional VSCode settings -# Put in remote settings because : https://github.com/coder/code-server/issues/4609 +RUN mkdir -p /home/coder/.local/share/code-server/User/ +COPY --chown=coder:coder settings/User.json /home/coder/.local/share/code-server/User/settings.json RUN mkdir -p /home/coder/.local/share/code-server/Machine/ -COPY settings.json /home/coder/.local/share/code-server/Machine/settings.json +COPY --chown=coder:coder settings/Machine.json /home/coder/.local/share/code-server/Machine/settings.json # INSTALL VSTUDIO EXTENSIONS RUN code-server --install-extension ms-python.python diff --git a/settings.json b/settings.json deleted file mode 100644 index 6dbc2b8..0000000 --- a/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "workbench.colorTheme": "Default Dark+", - "python.pythonPath": "/home/coder/local/bin/conda/envs/basesspcloud/bin/python", - "python.defaultInterpreterPath": "/home/coder/local/bin/conda/envs/basesspcloud/bin/python", - "terminal.integrated.inheritEnv": false, - "python.linting.flake8Enabled": true, - "python.testing.pytestEnabled": true -} diff --git a/settings/Machine.json b/settings/Machine.json new file mode 100644 index 0000000..ae7586d --- /dev/null +++ b/settings/Machine.json @@ -0,0 +1,3 @@ +{ + "python.defaultInterpreterPath": "/home/coder/local/bin/conda/envs/basesspcloud/bin/python" +} \ No newline at end of file diff --git a/settings/User.json b/settings/User.json new file mode 100644 index 0000000..0d3bd7d --- /dev/null +++ b/settings/User.json @@ -0,0 +1,8 @@ +{ + "workbench.colorTheme": "Default Dark+", + "security.workspace.trust.enabled": false, + "security.workspace.trust.startupPrompt": "never", + "terminal.integrated.inheritEnv": false, + "python.linting.flake8Enabled": true, + "python.testing.pytestEnabled": true +}