Code Monkey home page Code Monkey logo

docker_shiny-server_centos7's Introduction

Docker Configuration for Shiny-Server and RStudio Server on CentOS7.6

This configuration includes:

  • R

  • RStudio Server

  • Shiny-Server

Additional key R Packages include:

  • tidyverse readr RMySQL stringr reshape2

  • plotly ggplot2

  • DT

  • lubridate xts forecast

  • shinydashboard htmlwidgets shinyjs shinyBS shinyWidgets

Install other R packages with entrypoint.sh

R -e "install.packages(c('shiny'), repos='https://mirrors.tongji.edu.cn/CRAN/')"

Setup

  1. Install Docker on your system.

  2. Download or clone this repository.

Build the Dockerfile

docker build /YOUR_PATH_TO/docker_shiny-server_centos7 --tag="shiny-server"

View Your Docker Images

docker images

Run your Shiny-Server Docker image.

docker run -p 3838:3838 -p 8787:8787 -d shiny-server
  • Shiny-Server is running at localhost:3838

  • RStudio Server is running at localhost:8787

  • The username and password for RStudio Server is rstudio/isyscore.

Run your Shiny-Server Docker image with shiny app.

docker pull xwydq/rstudio-shiny-server
docker run --name zlj_shiny -p 7022:3838 -p 8786:8787 -v $(pwd)/hello_app/:/srv/shiny-server/hello_app xwydq/rstudio-shiny-server -d shiny-server

Volumn rstudio project dir to local

mkdir -p $(pwd)/rstudio_project
chmod 777 $(pwd)/rstudio_project
docker run --name zlj_shiny -p 7022:3838 -p 8786:8787 -v $(pwd)/rstudio_project/:/home/rstudio/project xwydq/rstudio-shiny-server -d shiny-server

docker container manage

# start 
docker container start <container ID>
# stop
docker container stop <container ID>
# delete
docker container rm -f <container ID>
# logs
docker logs <container ID>

Modify the Docker Container

This is a bare-bones container, so there is a good chance you will want to do some additional configuration. The command below will start your Docker instance and dump you into the root shell.

docker run -p 3838:3838 -p 8787:8787 -it shiny-server /bin/bash
  • Arg -i tells docker to attach stdin to the container.

  • Arg -t tells docker to give us a pseudo-terminal.

  • Arg /bin/bash will run a terminal process in your container.

Install Additional Stuff

Maybe you need a PostgreSQL instance?

yum install postgresql-devel -y

Exit the Container

exit

Find the Container ID

docker ps -a

Use Docker Commit to Save

The syntax is:

docker commit [CONTAINER ID] [REPOSITORY:TAG]

It should look something like this:

docker commit b59185b5ba4b docker-shiny:shiny-server-v2

See New Container

docker images

docker_shiny-server_centos7's People

Contributors

keberwein avatar pit-storm avatar xwydq avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.