From 414dba5693e6649f0f6632530a06f94dd2e9a518 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Wed, 5 Mar 2025 17:22:57 +0100 Subject: [PATCH] Add Dockerfile --- .Rbuildignore | 2 ++ DESCRIPTION | 1 - Dockerfile | 12 ++++++++++++ README.md | 15 +++++++++++---- docker/app.R | 2 ++ docker/shiny-server.conf | 11 +++++++++++ 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 Dockerfile create mode 100644 docker/app.R create mode 100644 docker/shiny-server.conf diff --git a/.Rbuildignore b/.Rbuildignore index 590a58f..5f1e7f6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,4 @@ +^docker$ ^scripts$ +^Dockerfile$ ^LICENSE\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index ae89a86..4f4e98a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,6 @@ Imports: gprofiler2, markdown, rclipboard, - readr, shiny, shinyWidgets Suggests: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9c6da4a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM rocker/shiny:4.4 + +COPY . /tmp/package/ + +RUN Rscript -e 'install.packages("pak")' && \ + Rscript -e 'pak::local_install("/tmp/package/")' + +COPY docker/app.R /srv/shiny-server/ubigen/app.R +COPY docker/shiny-server.conf /etc/shiny-server/shiny-server.conf + +EXPOSE 3464 +CMD ["/usr/bin/shiny-server"] diff --git a/README.md b/README.md index 2a503ec..aa33612 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ genes. It is publicly available at This repository contains an R package including the input data, the methods and the code for the interactive web interface. -## Installation +## Installation and Usage + +### Local You can install the development version of `ubigen` using: @@ -15,11 +17,9 @@ You can install the development version of `ubigen` using: pak::pkg_install("git::https://gitlab.uni-rostock.de/ep135/ubigen.git") ``` -## Usage - You only need one function to get started. It will run the application and serve the graphical user interface which can be viewed using your preferred -web browser. +web browser: ```r ubigen::run_app() @@ -28,6 +28,13 @@ ubigen::run_app() For additional information on using the R package, take a look at the built-in documentation (`?ubigen::run_app`). +### Server + +Docker images for deploying Ubigen on a server are available on Docker Hub at +[johrpan/ubigen](https://hub.docker.com/r/johrpan/ubigen). They expose the web +application at port 3464. We recommend setting up a reverse proxy to enable +TLS. + ## License This program is free software: you can redistribute it and/or modify it under diff --git a/docker/app.R b/docker/app.R new file mode 100644 index 0000000..4aaeedc --- /dev/null +++ b/docker/app.R @@ -0,0 +1,2 @@ +# This file is needed for Shiny Server to recognize Ubigen's shiny app. +ubigen::app() \ No newline at end of file diff --git a/docker/shiny-server.conf b/docker/shiny-server.conf new file mode 100644 index 0000000..bb9052e --- /dev/null +++ b/docker/shiny-server.conf @@ -0,0 +1,11 @@ +run_as shiny; + +server { + listen 3464; + + location / { + site_dir /srv/shiny-server/ubigen; + log_dir /var/log/shiny-server; + directory_index off; + } +}