This Docker image builds on shiny-server-arm-docker and adds the following features:
python3.11
: usingpython3.11.6
- Common data handling and visualization packages:
python
:shiny
: for running python shiny appsplotnine
:ggplot
for pythonseaborn
: plottingplotly
: interactive visualizationscikit-learn
: statistical analysispyarrow
: for reading data stored inparquet
files (better alternative tocsv
)
R
:tidyverse
: data sciencegt
: great looking tablesgtExtras
: additional features forgt
ggimage
: add images toggplot
ggtext
: modifying text inggplot
scales
: axis scales forggplot
Clone this repo and enter the directory:
git clone https://github.com/sravanpannala/shiny-server-arm-python ./shiny-server
cd shiny-server
Run docker compose
docker-compose up -d
The server will be available at:
http://localhost:3838/
You can change the port in docker-compose.yml
ports:
- {your_port_number}:3838
Libraries can be installed by modifying the init.sh
file under shiny-server/conf
.
It contains and will execute these commands:
py3.11 install package1 package2 .........
R -e "install.packages(c('lib1','lib2',...))
command the first time the container is started.
Simply add the libraries you wish installed there.
In order to avoid installing the same libraries on each restart,
the script generates an init_done
file and will not run if the file is present on the system.
To add additional libraries in subsequent runs,
delete the init_done
file and add the new libraries to init.sh
as before.
Please note that installed libraries will persist between restarts as long as the container image is not removed or recreated.
Apps can be added to the ~/shiny-server/apps
folder and will be loaded into shiny-server.
There are four example apps included, 3 in python and 1 in R.
If you followed the steps so far, the apps should be accessible at these urls:
Py-basic-app
: Running at http://localhost:3838/Py-basic-appPy-dashboard
: Running at http://localhost:3838/Py-dashboardPy-multi-page
: Running at http://localhost:3838/Py-multi-pageR-ggplot
: Running at http://localhost:3838/R-ggplot
You can add your own app by copying it over to the folder shiny-server/apps
,
where it will be available under http://localhost:3838/yourappfolder
.
You can add a configuration file for each app under shiny-server/apps/yourappfolder/.shiny_app.conf
.
If you run into any trouble along the way, it might be due to permission problems.
First, try making the init.sh
script executable:
chmod +x ~/shiny-server/conf/init.sh
If the issue is not solved, you can also try running the following command:
chmod -R 777 ~/shiny-server/
Shiny servers' configuration file can be found under shiny-server/conf/shiny-server.conf
.
The default settings should be sufficient, however you can also modify it according to your needs.
The documentation of shiny-server
is always a good place to start, when you want to tune your installation.
There are three versions of the image, tagged and snapshotted at various stages in the build process. The images can be found at dockerhub. Here are the images in the increasing order of size:
shiny-server-arm-python:python
: This image comes only with python support along with R and no packages.shiny-server-arm-python:pypackages
: This image comes with only python packages instaled and no R packages.shiny-server-arm-python:latest
: Normal image with all features. Installed by default.
If you want to change the image you want to install, you can do it in the docker-compose.yml, by changing the tag name:
image: sradjoker/shiny-server-arm-python:{tag}
This image can be build on an ARM machine by running the following code in this directory:
docker build -t shiny-server .
docker build
command uses the provided Dockerfile to build the image.
You can also customize your image by editing the dockerfile before building it.
Further instructions and resources are available shiny-server-arm-docker repo.
I suggest that you read the readme
file in that repo carefully.
This image is just a custom fork of that docker image suited to my purposes.
All the credit goes to hvalev who is the maintainer of shiny-server-arm-docker]
.
- shiny-server-arm-docker: orginal source of this docker image
- Python Configuration section of Shiny documentation
- Shiny Python documentation
- Shiny Server documentation