Shared Infrastructure

File Persistence

By default, deployed containers have ephemeral storage. To persist files across deploys and restarts:

Entity-level persistence (simple)

persist: true

The platform mounts a 1Gi persistent volume and injects CLOUDGRID_PERSIST_PATH as an environment variable pointing to the mount path. Use it in your code:

const dataDir = process.env.CLOUDGRID_PERSIST_PATH;
fs.writeFileSync(`${dataDir}/state.json`, JSON.stringify(state));

Custom size

persist:
  size: "5Gi"

Service-level persistence (granular)

services:
  api:
    type: node
    persist:
      - name: uploads
        path: /app/uploads
        size: 2Gi
      - name: cache
        path: /app/cache
        size: 500Mi