Skip to content

Commit

Permalink
add more dependecies
Browse files Browse the repository at this point in the history
  • Loading branch information
MeWu-IDM committed Sep 25, 2024
1 parent 8bf3cb3 commit 6289264
Show file tree
Hide file tree
Showing 4 changed files with 1,166 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ if [ -f "python/requirements.txt" ]; then
fi

# Install R dependencies
if [ -f "R/install_packages.R" ]; then
Rscript R/install_packages.R
if [ -f "r/install_packages.R" ]; then
Rscript r/install_packages.R
fi

# This may be done by the user
# Set up renv for R
#if [ -f "R/renv.lock" ]; then
# cd R && R -e 'renv::restore()'
#if [ -f "r/renv.lock" ]; then
# cd r && R -e 'renv::restore()'
#fi

# change the default working directory for RStudio
echo "session-default-working-dir=$CODESPACE_VSCODE_FOLDER" >> /etc/rstudio/rsession.conf
echo "session-default-working-dir=${CODESPACE_VSCODE_FOLDER}" >> /etc/rstudio/rsession.conf

rstudio-server start && jupyter lab --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token=''

Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ RUN apt-get update && apt-get install -y \
libxml2-dev \
libjpeg-dev \
libpng-dev \
libtiff5-dev \
libproj-dev \
libgdal-dev \
libxt-dev \
libarchive-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
gdebi-core \
software-properties-common \
ffmpeg \
Expand All @@ -44,6 +51,10 @@ ENV PATH="/opt/venv/bin:$PATH"
# Create an IPython kernel for the virtual environment
RUN /opt/venv/bin/python -m ipykernel install --user --name=venv --display-name "Python 3.12 (venv)"

# Install latest Quarto
RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.57/quarto-1.5.57-linux-amd64.deb
RUN dpkg -i quarto-1.5.57-linux-amd64.deb

# Expose ports for RStudio (8787) and Jupyter (8888)

#WORKDIR /workspaces
Expand All @@ -54,5 +65,12 @@ EXPOSE 8888
# Install renv globally for all users
RUN R -e "install.packages('renv', repos='https://cran.rstudio.com/')"

# Add /usr/local/bin to the PATH for all users
ENV PATH="/usr/local/bin:$PATH"

# Ensure the rstudio user's profile contains the updated PATH
RUN echo 'export PATH="/usr/local/bin:$PATH"' >> /home/rstudio/.bashrc
RUN usermod -aG sudo rstudio

# CMD to start both Jupyter and RStudio
#CMD ["bash", "-c", "rstudio-server start; jupyter lab --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token=''"]
2 changes: 1 addition & 1 deletion r/install_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (.Platform$OS.type == "unix") {


pkgnames <- c(
'devtools', 'DT',
'devtools', 'DT', 'languageserver', 'styler', 'httpgd',
'shiny', 'shinyjs', 'shinyalert', 'shinyWidgets', 'shinythemes', 'shinycssloaders', 'shinyBS', 'shinylive',
'dplyr','ggplot2', 'plotly', 'tidyr', 'stringr', 'logr', 'tidyverse',
'knitr', 'rmarkdown'
Expand Down
Loading

0 comments on commit 6289264

Please sign in to comment.