Skip to content

Commit

Permalink
build: switch to the rocker/shiny image as a base
Browse files Browse the repository at this point in the history
  • Loading branch information
ciyer committed Dec 18, 2024
1 parent a45ffc9 commit a0fb2ee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 79 deletions.
53 changes: 1 addition & 52 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1 @@
########################################################
# Renku install section - do not edit #

FROM renku/renkulab-py:3.10-0.24.0 as builder

# RENKU_VERSION determines the version of the renku CLI
# that will be used in this image. To find the latest version,
# visit https://pypi.org/project/renku/#history.
ARG RENKU_VERSION=2.9.4

# Install renku from pypi or from github if a dev version
RUN if [ -n "$RENKU_VERSION" ] ; then \
source .renku/venv/bin/activate ; \
currentversion=$(renku --version) ; \
if [ "$RENKU_VERSION" != "$currentversion" ] ; then \
pip uninstall renku -y ; \
gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(rc[[:digit:]]\+\)*\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\4/p") ; \
if [ -n "$gitversion" ] ; then \
pip install --no-cache-dir --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\
else \
pip install --no-cache-dir --force renku==${RENKU_VERSION} ;\
fi \
fi \
fi
# End Renku install section #
########################################################

FROM renku/renkulab-py:3.10-0.24.0

# Uncomment and adapt if code is to be included in the image
# COPY src /code/src

# Uncomment and adapt if your R or python packages require extra linux (ubuntu) software
# e.g. the following installs apt-utils and vim; each pkg on its own line, all lines
# except for the last end with backslash '\' to continue the RUN line
#
# USER root
# RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# apt-utils \
# vim
# USER ${NB_USER}

# install the python dependencies
COPY requirements.txt environment.yml /tmp/
RUN mamba env update -q -f /tmp/environment.yml && \
/opt/conda/bin/pip install -r /tmp/requirements.txt --no-cache-dir && \
mamba clean -y --all && \
mamba env export -n "root" && \
rm -rf ${HOME}/.renku/venv

COPY --from=builder ${HOME}/.renku/venv ${HOME}/.renku/venv
FROM rocker/shiny:4
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# Template for building Docker images in Renku 2.0
# Shiny Serving Demo

This is a demo project that serves a Shiny app from a Renku V2 project.


## References

This project builds on The Rocker Shiny which builds a Docker image containing the Shiny Server.

- https://rocker-project.org/images/versioned/shiny.html
- https://posit.co/download/shiny-server/
- https://github.com/rstudio/shiny-server/
15 changes: 0 additions & 15 deletions environment.yml

This file was deleted.

11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

0 comments on commit a0fb2ee

Please sign in to comment.