hi guys! it is not a web framework, it is just bot that works in infinite loop and makes some requests on some API. in the course of doing work the app writes logs.txt in the root dir (where main.py is). in the case of stopping app (SystemExit, KeyboardInterrupt) my app writes a small amount of data into SQLite3 file. in the case of any unexpected Exception it is doing the same as above and exiting. SQLite file is created in the root dir. The design is that the app has to be manually runnable and should not be automatically rerun if it fails and program exits. In this case I want to run the app by myself and the app is supposed to be reading the saved data from the SQlLite file. Resume:
thanks a lot for your help!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey Dennis 👋
I believe that we recently discussed this here:
In DigitalOcean’s App Platform, the filesystem is ephemeral, which means it doesn’t preserve files between deploys or application restarts, new deployments, and any container rebuilds. So, unfortunately, your logs and SQLite database would not persist if written to the local file system.
However, you can use other means to achieve persistence:
For logs: You can configure your application to send logs to an external log management service like Papertrail, Datadog, and Logtail:
For SQLite database: Instead of SQLite, you can use a database that supports persistence like PostgreSQL, MySQL, or MongoDB. You can host these databases on DigitalOcean’s Managed Databases, which offer automatic backups, failover, and other high availability features. If you wish to stick with SQLite, you could use an object storage service like DigitalOcean Spaces to store your SQLite file. However, you would need to manage uploading and downloading the file to Spaces when your application starts and stops, which can be a bit tricky.
An alternative option is to use a Droplet instead, that way you will be able to store both your SQLite and your logs on the Droplet without having to worry for the ephemeral storage on the App Platform:
Best,
Bobby