Add or grow app storage
set_app_storageGive an app storage that survives restarts and deploys, or grow the storage it already has. Call this when the app has to keep files: a SQLite database file, uploads, or anything the user expects to still be there tomorrow. The app reads and writes the folder at the path in the DATA_DIR environment variable, which Dockhold sets; anything written outside DATA_DIR is scratch space and is lost on the next restart. size_gb must be one of the sizes get_resource_usage reports under volume.steps_gb and has to fit your storage pool, which is the same pool a managed database draws on, so call get_resource_usage first. Storage can grow but never shrink. Three things to tell the user before calling this: an app with storage runs as a single copy, it cannot have scheduled tasks, and from now on each deploy stops the running version before the new one starts, so the app is unreachable for a few seconds. Write the app to save its files when it receives SIGTERM.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | The app id returned by list_apps | |
| size_gb | Yes | Storage size in GB, one of the values get_resource_usage reports under volume.steps_gb; must be at least the current size (storage grows, never shrinks) |