Useful links
Github projects
- https://github.com/saagie/shiny4saagie
- https://github.com/saagie/shiny4saagie-supercharged
- https://github.com/saagie/shiny4saagie-example
Docker Hub projects
- https://hub.docker.com/r/saagie/shiny4saagie/
- https://hub.docker.com/r/saagie/shiny4saagie-supercharged/
- https://hub.docker.com/r/saagie/shiny4saagie-example/
In order to deploy your Shiny App on Projects and Jobs, you need to use the v2 Github branch and the v2 docker image tag.
Your Shiny app in a Docker image
Your Dockerfile should look like:
FROM saagie/shiny4saagie
# Alternatively, use saagie/shiny4saagie-supercharged with pre-installed dependencies, or build your own
# intermediate layer that suits your needs
# Install R packages required by your Shiny app
RUN R -e 'install.packages(c("DT", "magrittr"), repos="http://cloud.r-project.org")'
# Copy your Shiny app to /srv/shiny-server/myapp
COPY myapp /srv/shiny-server/myapp
# Launch Shiny Server
CMD ["/usr/bin/shiny-server.sh"]
Your Shiny app should reside in a folder named myapp (or edit the Dockerfile accordingly) alongside the Dockerfile.
(See for instance the folder structure of https://github.com/saagie/shiny4saagie-example)
You may build your Docker image:
- either locally (requires docker-engine)
- or on https://hub.docker.com (for now you can only pull public images from the Saagie platform): either upload your manually built Docker image, or build automatically from a Github or Bitbucket repository
- or on an internal CI tool like https://jenkins.io/
Deploy your Shiny app on the platform
Within the Manager
- Pull from a public Docker hub repository:
The URL is: docker-hub-username/docker-image-name:tag-name (tag-name is optional).
The port is: 3838 - Pull from an internal repository:
Example URL to pull an image built internally with Jenkins: repos:5000/shiny4saagie-example
The port is: 3838
Within Projects and Jobs
In the Apps tab of your project, simply create a new App and select Docker image :
Then specify the name of your docker image (you can try first with saagie/shiny4saagie:v2) and expose an HTTP port with the following configuration :
- Port : 80
- Name : Shiny
- Inject base path variable : $SAAGIE_BASE_PATH
- Rewrite mode : NO
- Persistant storage : none
Warning: the URL of the Docker image must only contain <repository name> / <image_name> and not https://hub.docker.com/r/<repository_name> / <image_name>
Comments
0 comments
Article is closed for comments.