README.md

rshiny_in_docker_test

Repository to test using Rshiny in Docker with mounted volume

This repository aims to test the creation of a Docker container that has a Shiny app inside it that is able to write to a mounted volume. The app consists of only one button which, once clicked, tells the app to save a tiny text file to the mounted volume.

Installation

  1. Install Docker
  2. Clone this repository.
  3. cd to the Docker folder of this repo.
  4. docker build -t test-app . If you already have a rocker/shiny image then this should take less than a minute.

Run

  1. docker run --rm -it -v ~/:/srv/shiny-server/data/ -p 3838:3838 -u shiny test-app
  2. Open app in browser: http://localhost:3838/

Run in detached mode to check log file

  1. docker run --rm -d -v ~/:/srv/shiny-server/data/ -p 3838:3838 -u shiny --name my-test-run test-app
  2. docker exec -it my-test-run bash
  3. Open app in browser: http://localhost:3838/
  4. cd /var/log/shiny-server # Is shiny-server-shiny-*.log there? If yes, look inside/
  5. When done, to remove all containers: docker container kill $(docker container ls -q)


vincentvanhees/rshiny_in_docker_test documentation built on April 15, 2022, 7:28 p.m.