Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-install some extensions on code-server notebook #347

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions codeserver/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ WORKDIR /opt/app-root/bin
RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \
yum -y clean all --enablerepo='*'

# Change ownership of relevant directories
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P

# Install NGINX to proxy VSCode and pass probes check
ENV NGINX_VERSION=1.22 \
NGINX_SHORT_VER=122 \
Expand Down Expand Up @@ -78,8 +82,8 @@ COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/
COPY nginx/api/ /opt/app-root/api/

# Launcher
COPY utils utils/
COPY run-code-server.sh run-nginx.sh ./
COPY --chown=1001:0 utils utils/
COPY --chown=1001:0 run-code-server.sh run-nginx.sh ./

ENV SHELL /bin/bash

Expand Down
6 changes: 6 additions & 0 deletions codeserver/ubi9-python-3.9/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ fi
# Initilize access logs for culling
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/vscode.access.log

# Install extensions if not present
if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then
code-server --install-extension ms-python.python
code-server --install-extension ms-toolsai.jupyter
fi
harshad16 marked this conversation as resolved.
Show resolved Hide resolved

# Start server
start_process /usr/bin/code-server \
--bind-addr 0.0.0.0:8787 \
Expand Down