diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fff7794 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +.gitignore +.git +.ipynb_checkpoints +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9686b60 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM rocker/shiny + +# Add application codebase +ADD ./ /srv/shiny-server/anomaly_detection +RUN chmod a+rwx -R /srv/shiny-server/anomaly_detection + +# Temporal fix for RStan package +# http://discourse.mc-stan.org/t/error-when-installing-rstan-2-16-2/1730 +# https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Mac-or-Linux +RUN echo "\nCXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function" >> /etc/R/Makeconf +RUN echo "\nCXXFLAGS+=-DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION" >> /etc/R/Makeconf +RUN echo "\nCPPFLAGS+=-DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION" >> /etc/R/Makeconf + +# Install additional Ubuntu packages +RUN sudo apt-get update && sudo apt-get -y install libssl-dev + +# Install additional R packages +RUN R -e "install.packages('DT')" +RUN R -e "install.packages('shinyjs')" +RUN R -e "install.packages('shinydashboard')" +RUN R -e "install.packages('shinyBS')" +RUN R -e "install.packages('hiny')" +RUN R -e "install.packages('hinyBS')" +RUN R -e "install.packages('hinydashboard')" +RUN R -e "install.packages('dygraphs')" +RUN R -e "install.packages('plotly')" +RUN R -e "install.packages('smoother')" +RUN R -e "install.packages('prophet')" +RUN R -e "install.packages('Rssa')" +RUN R -e "install.packages('tringr')" +RUN R -e "install.packages('parallel')" diff --git a/README.md b/README.md index fe1f9ca..3c343df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ # Anomaly detection demo for AWS This repository contains code from the old anomaly detection project, transformed into R Shiny application with remote (AWS) deployment support. + +## Docker install ## + +1. Get application source code: +```bash +git clone https://github.com/SoftServeSAG/aws_anomaly_detection +cd aws_anomaly_detection/ +``` + +2. Build docker image: +```bash +docker build --rm --force-rm -t anomaly_detection . +``` + +3. Run docker image: +```bash +docker run --rm -p 3838:3838 anomaly_detection +``` + +4. Open your favorite browser and navigate to the `http://127.0.0.1:3838/anomaly_detection/`