Skip to content

Instantly share code, notes, and snippets.

@sckott
Last active January 1, 2016 20:18
Show Gist options
  • Save sckott/ea46be9a1c7cee0eef74 to your computer and use it in GitHub Desktop.
Save sckott/ea46be9a1c7cee0eef74 to your computer and use it in GitHub Desktop.

shiny server with analogsea

setup

install

devtools::install_github("sckott/analogsea")

load

library("analogsea")

Spin up a Shiny server

Create a droplet with Docker installed

d <- docklet_create() 
#> NB: This costs $0.01488 / hour until you droplet_delete() it
#> Waiting for create .......................................
#> <droplet>LimitlessHardship (9785776)
#>   IP:     159.203.218.218
#>   Status: active
#>   Region: San Francisco 1
#>   Image:  Docker 1.9.1 on 14.04
#>   Size:   1gb

Install RStudio Shiny server, and opens in default browser

d %>% docklet_shinyserver()
#> progress not shown ...

img1

Spin up a Shiny server with an app

Create a droplet with Docker installed

d <- docklet_create()
#> NB: This costs $0.01488 / hour until you droplet_delete() it
#> Waiting for create .......................................
#> <droplet>InboundsAbduction (9785807)
#>   IP:     159.203.218.204
#>   Status: active
#>   Region: San Francisco 1
#>   Image:  Docker 1.9.1 on 14.04
#>   Size:   1gb

Install RStudio Shiny server, with a Shiny application, and opens in default browser

path <- system.file("examples", "widgets", package = "analogsea")
d %>% docklet_shinyapp(path)

img2

If uploading more apps, just use droplet_upload(), then navigate in browser

If you try to use docklet_shinyapp() again on the same droplet, it will error

path2 <- system.file("examples", "mpg", package = "analogsea")
d %>% droplet_upload(path2, "/srv/shinyapps/mpg")

Then navigate to browser

img3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment