Deployment guide#

The RUINSapp consists of many different sub-applications. For this guide we assume that the full application should be deployed on a single server instance.

Webserver#

Install#

We need at least one instance serving the main website. In this guide, nginx is used. Install:

apt update && apt install -y nginx

Next, we need certbot to automatically install and auto-renew SSL certificates. Recommended way to install certbot is using snap, which needs to be installed in most cases first.

apt install snapd
snap install core
snap install certbot --classic

Then configure certbot:

Then request and install certificates for nginx

Configure website#

Streamlit is running on port 8501 by default. As we are using a docker container, we can bind this to any host port. To serve the Streamlit app to public you need to either open these ports or use a webserver to proxy them using a path or subdomain. As the apps should be served using SSL encryption, you need to setup and configure nginx anyway. There are many ways to do so, the recommended way is to create a new site configuration in /etc/nginx/sites-available and then activate that site.

I.e: /etc/nginx/sites-available/ruins.conf

Docker#

Install docker on the host machine:

apt install -y ca-certificates curl gnupg lsb-release

Add dockers GPG key and add package repository to sources

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install docker

aaaand finally:

`bash docker run -d -i  -p 42001:8501  --name weather  --restart always  ghcr.io/hydrocode-de/ruins:v0.6.0 weather.py `