Created this as I encountered this issue deploying via ELB CLI
-
Add instructions for deploying to Elastic beanstalk - Add instructions for testing locally
- Add instructions for mounting persistent storage for apps
- Add ui for users to upload apps to the shiny server
-
Clone this repo via the command line:
git clone https://github.com/ranvirm/shiny-server-elastic-beanstalk.git
-
Navigate into the cloned folder
cd shiny-server-elastic-beanstalk/
-
Create a new folder named myapp under the apps folder
mkdir ./apps/myapp
The new folder directory should look like:
shiny-server-elastic-beanstalk/ /apps /hello-app /myapp Dockerfile Dockerrun.aws.json shiny-server.sh .dockerignore .gitignore
-
Copy all your shiny app code + files into the myapp folder
cp -R ..path_to_your_app/* ./apps/myapp
-
Add the R packages your app uses. Open Dockerfile and add your packages to the list on line 17
RUN R -e "install.packages(c('dplyr', 'pandas', 'shinySignals'))"
-
In the root folder (shiny-server-elastic-beanstalk/) run the below to create a zip file:
zip -r deployment.zip .
-
The newly created deployment.zip file is the file you will upload to elastic beanstalk
-
Navigate to the Elastic Beanstalk UI in the AWS console
-
Click Create a new Environment
-
Select Web server environment and click Select
-
Fill in the required fields:
- Application name: shiny-server-1 (or whatever you want)
- Environment name: shiny-server-env-1 (or whatever you want)
- Under Platform
- Select Managed platform
- Under Platform select Docker
- Leave the populated values as default
- Under Application code:
- Select Upload your code
- Enter a version: 1.0 (or whatever you want)
- Select Local file
- Click Choose file and upload your zipped deployment file that you created earlier: deployment.zip
-
Click Create Environment
This will begin the deployment and may take a few minutes to complete -
Once the deployment has completed you will be presented with a url to the shiny server
Going to the url will open up the shiny server homepage
Add /apps/myapp/ to the end of the homepage url to view your app or the sample app with /apps/shiny-app/