The same files on every version
A new deployment mounts the volume the last one used. Uploads, exports, and caches carry over without a copy step.
- v14Live/uploads
- v13/uploads
- v12/uploads
Give an app a volume at any mount path and write to it like a normal disk. The files stay with the app across deployments, and S3-compatible tools can reach them when you turn that on.
An app writes files to a volume. The volume grows as it fills, and S3 tools can read the same files.
An illustration, with example data.
Powering products and agents at
Create the volume with a mount path and a size. Update it later to switch on S3 access, and redeploy the app in the same call so it picks up the change.
$ npm install stackmachineimport StackMachine from "stackmachine";
const client = new StackMachine(process.env.STACKMACHINE_API_KEY);
const volume = await client.apps.volumes.create({
app: "da_XYZ",
mountPath: "/uploads",
maxSizeBytes: 1_073_741_824,
});
// Open the same files to S3-compatible tools.
const updated = await client.apps.volumes.update(volume.id, {
mountPath: "/uploads",
s3Enabled: true,
redeployApp: true,
});
console.log(updated.s3Url, updated.explorerUrl);Start with a mounted path. Open it up when other tools need the same files.
A new deployment mounts the volume the last one used. Uploads, exports, and caches carry over without a copy step.
Set redeployApp when you update a volume and the app moves onto a version with the new settings straight away.
More in the documentation.
One API key for hosting, storage, databases, email, and cron.