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 540b918..1aeb704 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("johrpan/ubigen") ``` -## 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,12 @@ ubigen::run_app() For additional information on using the R package, take a look at the built-in documentation (`?ubigen::run_app`). +### Server + +The [`Dockerfile`](Dockerfile) included in this repository can be used to +deploy Ubigen on a server. It exposes 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; + } +}