Skip to content

Commit

Permalink
update docker image to install required libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
MeWu-IDM committed Sep 25, 2024
1 parent a7b0869 commit 5bedf28
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if [ -f "python/requirements.txt" ]; then
fi

# Install R dependencies
if [ -f "r/install_packages.R" ]; then
Rscript r/install_packages.R
fi
#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
Expand All @@ -20,8 +20,9 @@ fi
#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}" | sudo tee -a /etc/rstudio/rsession.conf

rstudio-server start && jupyter lab --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token=''
rstudio-server start > rstudio_server.log 2>&1 &
jupyter lab --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token='' 2>&1 &

echo "Dev environment setup completed!"
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
- name: Run Quarto in Docker container
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace my-quarto-image bash -c "
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace demo-quarto-image bash -c "
echo 'Creating gallery directory...'
mkdir -p gallery && \
echo 'gallery directory created.'
FOLDERS=(python, R)
FOLDERS=(python R)
echo 'Folders to process: ${FOLDERS[@]}'
for FOLDER in \"\${FOLDERS[@]}\"; do
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ RUN dpkg -i quarto-1.5.57-linux-amd64.deb

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

#WORKDIR /workspaces
WORKDIR /app

COPY r /app/r

EXPOSE 8787
EXPOSE 8888

# Install renv globally for all users
RUN R -e "install.packages('renv', repos='https://cran.rstudio.com/')"

# Install R packages
RUN Rscript /app/r/install_packages.R

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

Expand Down

0 comments on commit 5bedf28

Please sign in to comment.