Skip to content

Commit

Permalink
update rserver starting scripts (#22)
Browse files Browse the repository at this point in the history
* update devbox
* perm +x for scripts
  • Loading branch information
haobibo authored Nov 7, 2024
1 parent 4315943 commit a0c77b9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
7 changes: 5 additions & 2 deletions docker_devbox/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ARG ARG_KEEP_NODEJS=true
COPY work /opt/utils/

RUN set -eux && source /opt/utils/script-utils.sh \
&& chmod +x /opt/utils/*.sh \
# ----------------------------- Setup Jupyter: Basic Configurations and Extensions
&& mkdir -pv /opt/conda/etc/jupyter/ \
&& mv /opt/utils/etc_jupyter/* /opt/conda/etc/jupyter/ && rm -rf /opt/utils/etc_jupyter \
Expand All @@ -39,8 +40,10 @@ RUN set -eux && source /opt/utils/script-utils.sh \
# ----------------------------- If installing R IDEs: R_rstudio and R_rshiny
&& source /opt/utils/script-devbox-rstudio.sh \
&& for profile in $(echo $ARG_PROFILE_R | tr "," "\n") ; do ( setup_R_${profile} ) ; done \
# ----------------------------- Install supervisord & caddy
&& source /opt/utils/script-setup-devbox.sh && setup_supervisord && setup_caddy \
# ----------------------------- Install supervisord
&& source /opt/utils/script-setup-sys.sh && setup_supervisord \
# ----------------------------- Install caddy
&& source /opt/utils/script-setup-net.sh && setup_caddy \
# Clean up and display components version information...
&& install__clean && list_installed_packages

Expand Down
3 changes: 2 additions & 1 deletion docker_devbox/hub.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ ARG ARG_KEEP_NODEJS=true
COPY work /opt/utils/

RUN set -eux \
&& chmod +x /opt/utils/*.sh \
# Setup JupyterHub
&& source /opt/utils/script-devbox-jupyter.sh \
&& mv /opt/utils/start-*.sh /usr/local/bin/ && chmod +x /usr/local/bin/start-*.sh \
&& for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} || true ) ; done \
# If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead
&& if [ ${ARG_KEEP_NODEJS} = "false" ] ; then \
echo "Removing Node/NPM..." && rm -rf /usr/bin/node /usr/bin/npm /usr/bin/npx /opt/node ; \
echo "Installing Traefik to server as proxy:" && source /opt/utils/script-setup.sh && setup_traefik ; \
echo "Installing Traefik to server as proxy:" && source /opt/utils/script-setup-net.sh && setup_traefik ; \
else \
echo "Keep NodeJS as ARG_KEEP_NODEJS defiend as: ${ARG_KEEP_NODEJS}" ; \
fi \
Expand Down
24 changes: 0 additions & 24 deletions docker_devbox/work/script-setup-devbox.sh

This file was deleted.

7 changes: 7 additions & 0 deletions docker_devbox/work/start-rserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ "$RSTUDIO_ARGS $@" != *"--www-port="* ]]; then
RSTUDIO_ARGS="--www-port=8787 $RSTUDIO_ARGS"
fi
if [[ "$RSTUDIO_ARGS $@" != *"--auth-none="* ]]; then
RSTUDIO_ARGS="--auth-none 1 $RSTUDIO_ARGS"
fi
if [[ "$RSTUDIO_ARGS $@" != *"--www-root-path="* ]]; then
WWW_ROOT_PATH=$(echo "${JUPYTERHUB_SERVICE_PREFIX%/}/rserver/" || echo "/rserver/")
RSTUDIO_ARGS="--www-root-path $WWW_ROOT_PATH $RSTUDIO_ARGS"
fi


USER=root /opt/rstudio-server/bin/rserver ${RSTUDIO_ARGS} $@

0 comments on commit a0c77b9

Please sign in to comment.