My site writes new .html
files into /tmp
after the dyno is created.
The cherrypy
app is in /app
due to the Heroku's structure.
This prevents me from routing the .html
files created with Cherrypy. Any idea on how to do this?
Heroku's filesystem is ephemeral:
Each dyno gets its own ephemeral filesystem, with a fresh copy of the most recently deployed code. During the dyno’s lifetime its running processes can use the filesystem as a temporary scratchpad, but no files that are written are visible to processes in any other dyno and any files written will be discarded the moment the dyno is stopped or restarted. For example, this occurs any time a dyno is replaced due to application deployment and approximately once a day as part of normal dyno management.
It's not meant for permanent storage, and anything you write out to disk can disappear at any moment.
If you need to write data out persistently you can use something like Amazon S3 or store it in a database.
Will it be possible to serve the code directly from db then? Assuming that i write the code into db?
Yes.
Heroku itself provides a PostgreSQL service and many others are available from the addons marketplace.