Sign inSign up

tuur29/rwebtool-rserver

By tuur29

Updated over 1 year ago

Image
0

1.4K

tuur29/rwebtool-rserver repository overview

RWebTool Rserver Docker setup

This container sets up a FastRWeb server that allows you to generate output via R based on predetermined set of scripts and data by using basic GET calls.

Built-ins

The following extra features are provided:

  • The R server will reboot itself and clear it caches every week (monday at around midnight) to see if new data was uploaded.
  • Easy way to restart R without restarting entire docker (useful to apply data / script changes): http://localhost:PORT/cgi-bin/rebootRserve.sh

Options

  • Mountpoints:
    • /var/FastRWeb/logs/: R log files (make sure to mount as read/write)
    • /var/FastRWeb/data/: contains csv's or other data to load (mount readonly)
    • /var/FastRWeb/web.R/: contains R scripts that can be executed via a GET call (mount readonly)
      • startup.R (optional): use this script to setup global data (like loading packages & data)
      • common.R (optional): similar to the file above, but executed at the start of every call instead
  • Port: 80
    • Example: http://localhost:PORT/cgi-bin/R/ping will call the called under /var/FastRWeb/web.R/ping.R

Example commands

Starting the container:

docker run \
    --name rserver \
    -p 8080:80 \
    --mount "type=bind,src=C:\Users\tuur\git\rwebtool\server\logs,target=/var/FastRWeb/logs" \
    --mount "type=bind,src=C:\Users\tuur\git\rwebtool\server\data,target=/var/FastRWeb/data,readonly" \
    --mount "type=bind,src=C:\Users\tuur\git\rwebtool\server\web.R,target=/var/FastRWeb/web.R,readonly" \
    tuur29/rwebtool-rserver

Creating a new build of the container: docker build -f docker/rserver.Dockerfile . -t tuur29/rwebtool-rserver
Please not this command should be run from inside the project root.

Used packages

  • Apache
  • Cron
  • R, with the following packages:
    • Cairo
    • Matrix
    • base64enc
    • FastRWeb
    • xtable
    • descr
    • Rserve

Tag summary

Content type

Image

Digest

sha256:040e4255b

Size

442.8 MB

Last updated

over 1 year ago

docker pull tuur29/rwebtool-rserver