kanvas-ai / artindex

Art Index
GNU General Public License v3.0
0 stars 0 forks source link

Art Index

Install Streamlit

Streamlit requires Python 3.8 (3.9 appears not yet to be supported)

$ virtualenv -p /usr/bin/python3.8 venv

$ source venv/bin/activate

$ pip install streamlit

Install Requirements - Streamlit Standalone

$ git pull https://github.com/kanvas-ai/artindex.git

$ pip install -r requiments.txt

$ streamlit run Home.py

This should launch a browser on localhost:8501.

Update Content - Streamlit + Ngnix

Update Code

$ cd artindex $ git pull https://github.com/kanvas-ai/artindex.git

Reload Ngnix / Streamlit

$ sudo systemctl daemon-reload
$ sudo systemctl stop artindex
$ sudo systemctl disable artindex
$ sudo systemctl start artindex
$ sudo systemctl enable artindex
$ sudo systemctl status artindex

New Files

AWS Deployment Instructions

[Service] Type=simple User=ubuntu ExecStart=/path/to/venv/bin/streamlit run /path/to/your/app.py Restart=always RestartSec=5

[Install] WantedBy=multi-user.target

Start the Streamlit app service and enable it to run on startup:

$ sudo systemctl start streamlit-app $ sudo systemctl enable streamlit-app


### Configure Nginx

Create a new Nginx configuration file:

sudo nano /etc/nginx/sites-available/streamlit-app


Add the following configuration, adjusting the server_name to your domain name:

server { listen 80; server_name example.com;

location / {
    proxy_pass http://localhost:8501;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}

Create a symbolic link to the sites-enabled directory:

$ sudo ln -s /etc/nginx/sites-available/streamlit-app /etc/nginx/sites-enabled

Test the Nginx configuration and restart the Nginx service:

sudo nginx -t sudo systemctl restart nginx