Mount Path Disk - Python app

Hi everybody,

I have a basic webapp designed with Streamlit in Python. Streamlit is extremely easy to deploy with just a single line of code:
streamlit run my_app.py

As I added a sqlite3 database to store some data form the webapp, I wanted to add Disk space to my webapp, so that the data are not getting lost each time a new version of my webapp is being deployed.

Issue:

After many hours spent in trying to understand how to setup the mount path of the Disk, I wasn’t able to set it up.
I have noticed that the folder coming from the github is being stored in opt/render/project/src, so tried to point to the same path, but it didn’t work.
In addition; I tried to set the mount path to /opt/var/app_name, but again without success.

Therefore, WHAT SHOULD BE THE MOUNT PATH OF DISK?

Thanks in advance!

Hey Opreka.

I just tested this by attaching a disk to /opt/var/app_name and it seemed to work.

After the service deploys:

$ echo "Hello World" > /opt/var/app_name/hello.out
$ cat /opt/var/app_name/hello.out 
Hello World

After deploying again:

$ cat /opt/var/app_name/hello.out 
Hello World

To clarify: When you add a disk, only files within that directory will persist across deploys. Files in /opt/render/project will be overwritten during the build, so a disk shouldn’t be used for that directory. Could you share the steps to reproduce the issue?