Giter Site home page Giter Site logo

shinyazuredocker's Introduction

Set Working Directory

cd /Volumes/LocalDrive/Docker

Let's create a directory for our application

mkdir Docker

Lets Create Data loading script and place it in a folder

mkdir data-prep

touch data-prep/data-prep-script.R

Place the data inside the data-prep folder

Now Create APP.R file to build our application

mkdir shiny-app

touch shiny-app/app.R

After completing the app, place the saved RDS data file in this directory

Now Let's create RProj file for the application with default parameters

touch shiny-app-docker.Rproj

Time to create Dockerfile to build our docker

touch Dockerfile

Lets build our Docker Image

docker build -t my-shiny-app .

Run the docker

docker run --rm -p 3838:3838 my-shiny-app

Check the app running in docker

http://localhost:3838

Lets push our docker image to Azure

Login into Azure

az login

Create Azure Resource group and provide region

az group create --name shinyapps --location northeurope

Create Azure Container Service to host our Docker Image

az acr create -n shinyappdocker -g shinyapps --sku Basic

Create A Service plan for our application, choosing Linux Basic Free version

az appservice plan create -g shinyapps -n shinyappplan --sku FREE --is-linux

One more step to push docker to Azure

Log into Azure container registry

docker login shinyappdocker.azurecr.io

It will prompt for Username and Password

Log into Azure Portal in a browser, go to the resource group we created shinyapps ---> shinyappdocker ---> Access Keys --> Enable Admin User ---> copy Username and password

check for login succesful message

Tag the image of the docker to the Azure container registry

docker tag my-shiny-app shinyappdocker.azurecr.io/my-shiny-app

Push the docker image to the cloud

docker push shinyappdocker.azurecr.io/my-shiny-app

Time to deploy

az webapp create -g shinyapps -p shinyappplan -n myshinyappindocker -i shinyappdocker.azurecr.io/my-shiny-app

Once its deployed, get the link for the application

https://myshinyappindocker.azurewebsites.net

shinyazuredocker's People

Contributors

harish2f 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.